Rev 4422: Some cleanup. Move the check that from_dict works into test_chk_map. in http://bazaar.launchpad.net/~jameinel/bzr/1.16-chk-direct

John Arbash Meinel john at arbash-meinel.com
Wed Jun 17 19:24:08 BST 2009


At http://bazaar.launchpad.net/~jameinel/bzr/1.16-chk-direct

------------------------------------------------------------
revno: 4422
revision-id: john at arbash-meinel.com-20090617182359-3ms8skqdaxn3db9m
parent: john at arbash-meinel.com-20090608182135-mxmy7bbhluq9rm7x
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 1.16-chk-direct
timestamp: Wed 2009-06-17 13:23:59 -0500
message:
  Some cleanup. Move the check that from_dict works into test_chk_map.
-------------- next part --------------
=== modified file 'bzrlib/chk_map.py'
--- a/bzrlib/chk_map.py	2009-06-08 18:21:35 +0000
+++ b/bzrlib/chk_map.py	2009-06-17 18:23:59 +0000
@@ -203,18 +203,9 @@
             multiple pages.
         :return: The root chk of the resulting CHKMap.
         """
-        # root_key = klass._create_via_map(store, initial_value,
-        #     maximum_size=maximum_size, key_width=key_width,
-        #     search_key_func=search_key_func)
         root_key = klass._create_directly(store, initial_value,
             maximum_size=maximum_size, key_width=key_width,
             search_key_func=search_key_func)
-        # if root_key != alt_root_key:
-        #     result1 = klass(store, root_key, search_key_func=search_key_func)
-        #     result2 = klass(store, alt_root_key,
-        #                     search_key_func=search_key_func)
-        #     import pdb; pdb.set_trace()
-        #     raise ValueError('Failed to serialize via leaf splitting.')
         return root_key
 
     @classmethod

=== modified file 'bzrlib/tests/test_chk_map.py'
--- a/bzrlib/tests/test_chk_map.py	2009-06-05 18:03:40 +0000
+++ b/bzrlib/tests/test_chk_map.py	2009-06-17 18:23:59 +0000
@@ -78,6 +78,11 @@
         root_key = CHKMap.from_dict(chk_bytes, a_dict,
             maximum_size=maximum_size, key_width=key_width,
             search_key_func=search_key_func)
+        root_key2 = CHKMap._create_via_map(chk_bytes, a_dict,
+            maximum_size=maximum_size, key_width=key_width,
+            search_key_func=search_key_func)
+        self.assertEqual(root_key, root_key2, "CHKMap.from_dict() did not"
+                         " match CHKMap._create_via_map")
         chkmap = CHKMap(chk_bytes, root_key, search_key_func=search_key_func)
         return chkmap
 



More information about the bazaar-commits mailing list