Rev 4616: (robertc) Change a KnownFailure into a test with two success paths in in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Mon Aug 17 00:16:54 BST 2009


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 4616 [merge]
revision-id: pqm at pqm.ubuntu.com-20090816231652-3v3cyyio0ibr7odn
parent: pqm at pqm.ubuntu.com-20090815123000-raj3s1ovqhy4abfs
parent: robertc at robertcollins.net-20090814041142-qvp473zy7vcxa7nl
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Mon 2009-08-17 00:16:52 +0100
message:
  (robertc) Change a KnownFailure into a test with two success paths in
  	preperation for 2a as default. (Robert Collins)
modified:
  bzrlib/tests/test_repository.py test_repository.py-20060131075918-65c555b881612f4d
=== modified file 'bzrlib/tests/test_repository.py'
--- a/bzrlib/tests/test_repository.py	2009-06-29 15:07:51 +0000
+++ b/bzrlib/tests/test_repository.py	2009-08-14 04:11:42 +0000
@@ -1008,14 +1008,17 @@
         """
         broken_repo = self.make_broken_repository()
         empty_repo = self.make_repository('empty-repo')
-        # See bug https://bugs.launchpad.net/bzr/+bug/389141 for information
-        # about why this was turned into expectFailure
-        self.expectFailure('new Stream fetch fills in missing compression'
-           ' parents (bug #389141)',
-           self.assertRaises, (errors.RevisionNotPresent, errors.BzrCheckError),
-                              empty_repo.fetch, broken_repo)
-        self.assertRaises((errors.RevisionNotPresent, errors.BzrCheckError),
-                          empty_repo.fetch, broken_repo)
+        try:
+            empty_repo.fetch(broken_repo)
+        except (errors.RevisionNotPresent, errors.BzrCheckError):
+            # Test successful: compression parent not being copied leads to
+            # error.
+            return
+        empty_repo.lock_read()
+        self.addCleanup(empty_repo.unlock)
+        text = empty_repo.texts.get_record_stream(
+            [('file2-id', 'rev3')], 'topological', True).next()
+        self.assertEqual('line\n', text.get_bytes_as('fulltext'))
 
 
 class TestRepositoryPackCollection(TestCaseWithTransport):




More information about the bazaar-commits mailing list