/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/tests/test_chk_map.py

  • Committer: Jelmer Vernooij
  • Date: 2018-08-19 13:46:02 UTC
  • mto: This revision was merged to the branch mainline in revision 7100.
  • Revision ID: jelmer@jelmer.uk-20180819134602-vh586nkdi0p5etnw
Fix remaining chk_map tests on Python 3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
372
372
                # Internal nodes must have identical references
373
373
                self.assertEqual(sorted(node_one._items.keys()),
374
374
                                 sorted(node_two._items.keys()))
375
 
                node_one_stack.extend([n for n, _ in
376
 
                                       node_one._iter_nodes(map_one._store)])
377
 
                node_two_stack.extend([n for n, _ in
378
 
                                       node_two._iter_nodes(map_two._store)])
 
375
                node_one_stack.extend(sorted(
 
376
                    [n for n, _ in node_one._iter_nodes(map_one._store)],
 
377
                    key=lambda a: a._search_prefix))
 
378
                node_two_stack.extend(sorted(
 
379
                    [n for n, _ in node_two._iter_nodes(map_two._store)],
 
380
                    key=lambda a: a._search_prefix))
379
381
            else:
380
382
                # Leaf nodes must have identical contents
381
383
                self.assertEqual(node_one._items, node_two._items)
1440
1442
                             "      ('3',) 'baz'\n"
1441
1443
                             "  '\\x83' LeafNode\n"
1442
1444
                             "      ('1',) 'foo'\n"
1443
 
                             , chkmap._dump_tree())
 
1445
                             , chkmap._dump_tree(encoding='latin1'))
1444
1446
        root_key = chkmap._save()
1445
1447
        chkmap = chk_map.CHKMap(chk_bytes, root_key,
1446
1448
                                search_key_func=chk_map._search_key_255)
1454
1456
                             "      ('3',) 'baz'\n"
1455
1457
                             "  '\\x83' LeafNode\n"
1456
1458
                             "      ('1',) 'foo'\n"
1457
 
                             , chkmap._dump_tree())
 
1459
                             , chkmap._dump_tree(encoding='latin1'))
1458
1460
 
1459
1461
    def test_search_key_collisions(self):
1460
1462
        chkmap = chk_map.CHKMap(self.get_chk_bytes(), None,