Rev 3813: Fix 'test_pack_preserves_chk_bytes_store'. in http://bazaar.launchpad.net/%7Ebzr/bzr/brisbane-core
John Arbash Meinel
john at arbash-meinel.com
Thu Feb 12 19:27:47 GMT 2009
At http://bazaar.launchpad.net/%7Ebzr/bzr/brisbane-core
------------------------------------------------------------
revno: 3813
revision-id: john at arbash-meinel.com-20090212192701-3klzx0zhf2ook6pb
parent: robertc at robertcollins.net-20090210225446-5vc8llbvwnxpbkp5
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: brisbane-core
timestamp: Thu 2009-02-12 13:27:01 -0600
message:
Fix 'test_pack_preserves_chk_bytes_store'.
We changed the serialized format, so pull out the actual lines to make it easier to maintain.
-------------- next part --------------
=== modified file 'bzrlib/tests/per_repository_chk/test_supported.py'
--- a/bzrlib/tests/per_repository_chk/test_supported.py 2008-11-12 04:17:01 +0000
+++ b/bzrlib/tests/per_repository_chk/test_supported.py 2009-02-12 19:27:01 +0000
@@ -16,6 +16,7 @@
"""Tests for repositories that support CHK indices."""
+from bzrlib import osutils
from bzrlib.versionedfile import VersionedFiles
from bzrlib.tests.per_repository_chk import TestCaseWithRepositoryCHK
@@ -65,18 +66,19 @@
repo.unlock()
def test_pack_preserves_chk_bytes_store(self):
- expected_set = set([('sha1:4e6482a3a5cb2d61699971ac77befe11a0ec5779',),
- ('sha1:af554bebcd35f8573896f3f6314bc46dd832e01c',)])
+ leaf_lines = ["chkleaf:\n", "0\n", "1\n", "0\n", "\n"]
+ leaf_sha1 = osutils.sha_strings(leaf_lines)
+ node_lines = ["chknode:\n", "0\n", "1\n", "1\n", "foo\n",
+ "\x00sha1:%s\n" % (leaf_sha1,)]
+ node_sha1 = osutils.sha_strings(node_lines)
+ expected_set = set([('sha1:' + leaf_sha1,), ('sha1:' + node_sha1,)])
repo = self.make_repository('.')
repo.lock_write()
try:
repo.start_write_group()
try:
# Internal node pointing at a leaf.
- repo.chk_bytes.add_lines((None,), None,
- ["chknode:\n", "0\n", "1\n", "1\n",
- "foo\x00sha1:4e6482a3a5cb2d61699971ac77befe11a0ec5779\n"],
- random_id=True)
+ repo.chk_bytes.add_lines((None,), None, node_lines, random_id=True)
except:
repo.abort_write_group()
raise
@@ -85,8 +87,7 @@
repo.start_write_group()
try:
# Leaf in a separate pack.
- repo.chk_bytes.add_lines((None,), None,
- ["chkleaf:\n", "0\n", "1\n", "0\n"], random_id=True)
+ repo.chk_bytes.add_lines((None,), None, leaf_lines, random_id=True)
except:
repo.abort_write_group()
raise
More information about the bazaar-commits
mailing list