Rev 3233: Review Repository iter_reverse_revision_history tests for use with a read-instance repository. in http://people.ubuntu.com/~robertc/baz2.0/shallow-branch

Robert Collins robertc at robertcollins.net
Tue Feb 19 01:35:46 GMT 2008


At http://people.ubuntu.com/~robertc/baz2.0/shallow-branch

------------------------------------------------------------
revno: 3233
revision-id:robertc at robertcollins.net-20080219013542-9ehe02ek6mje4sqs
parent: robertc at robertcollins.net-20080219011253-rh21k7b3fm46ypd6
committer: Robert Collins <robertc at robertcollins.net>
branch nick: repository_implementations.split_read_write
timestamp: Tue 2008-02-19 12:35:42 +1100
message:
  Review Repository iter_reverse_revision_history tests for use with a read-instance repository.
modified:
  bzrlib/tests/repository_implementations/test_iter_reverse_revision_history.py test_iter_reverse_re-20070217015036-spu7j5ggch7pbpyd-1
=== modified file 'bzrlib/tests/repository_implementations/test_iter_reverse_revision_history.py'
--- a/bzrlib/tests/repository_implementations/test_iter_reverse_revision_history.py	2007-09-25 08:14:12 +0000
+++ b/bzrlib/tests/repository_implementations/test_iter_reverse_revision_history.py	2008-02-19 01:35:42 +0000
@@ -89,8 +89,7 @@
 
     def test_is_generator(self):
         tree = self.create_linear_history()
-        repo = tree.branch.repository
-
+        repo = self._make_test_read_instance(tree.branch.repository)
         rev_history = repo.iter_reverse_revision_history('rev4')
         self.assertEqual('rev4', rev_history.next())
         self.assertEqual('rev3', rev_history.next())
@@ -100,33 +99,30 @@
 
     def assertRevHistoryList(self, expected, repo, revision_id):
         """Assert the return values of iter_reverse_revision_history."""
-        actual = list(repo.iter_reverse_revision_history(revision_id))
+        actual = list(self._make_test_read_instance(
+            repo).iter_reverse_revision_history(revision_id))
         self.assertEqual(expected, actual)
 
     def test_linear_history(self):
         tree = self.create_linear_history()
-        repo = tree.branch.repository
-
+        repo = self._make_test_read_instance(tree.branch.repository)
         self.assertRevHistoryList(['rev4', 'rev3', 'rev2', 'rev1'],
                                   repo, 'rev4')
 
     def test_partial_history(self):
         tree = self.create_linear_history()
-        repo = tree.branch.repository
-
+        repo = self._make_test_read_instance(tree.branch.repository)
         self.assertRevHistoryList(['rev3', 'rev2', 'rev1'], repo, 'rev3')
 
     def test_revision_ids_are_utf8(self):
         tree = self.create_linear_history_with_utf8()
-        repo = tree.branch.repository
-
+        repo = self._make_test_read_instance(tree.branch.repository)
         self.assertRevHistoryList(['rev-\xc3\xa5', 'rev-\xc2\xb5'],
                                   repo, 'rev-\xc3\xa5')
 
     def test_merged_history(self):
         tree1, tree2 = self.create_merged_history()
-        repo = tree1.branch.repository
-
+        repo = self._make_test_read_instance(tree1.branch.repository)
         self.assertRevHistoryList(['rev-1-1'],
                                   repo, 'rev-1-1')
         self.assertRevHistoryList(['rev-1-2', 'rev-1-1'],



More information about the bazaar-commits mailing list