Rev 2489: Adding a simple sprout test to make sure it creates the target branch with the right format in http://bzr.arbash-meinel.com/branches/bzr/0.17-dev/branch_from_merged_115343

John Arbash Meinel john at arbash-meinel.com
Mon May 21 17:44:24 BST 2007


At http://bzr.arbash-meinel.com/branches/bzr/0.17-dev/branch_from_merged_115343

------------------------------------------------------------
revno: 2489
revision-id: john at arbash-meinel.com-20070521164413-tp0zcdi51i5dxkv2
parent: john at arbash-meinel.com-20070521151804-dgnr0rfe2j9brq1m
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: branch_from_merged_115343
timestamp: Mon 2007-05-21 18:44:13 +0200
message:
  Adding a simple sprout test to make sure it creates the target branch with the right format
modified:
  bzrlib/tests/branch_implementations/test_sprout.py test_sprout.py-20070521151739-b8t8p7axw1h966ws-1
-------------- next part --------------
=== modified file 'bzrlib/tests/branch_implementations/test_sprout.py'
--- a/bzrlib/tests/branch_implementations/test_sprout.py	2007-05-21 15:18:04 +0000
+++ b/bzrlib/tests/branch_implementations/test_sprout.py	2007-05-21 16:44:13 +0000
@@ -16,7 +16,10 @@
 
 """Tests for Branch.sprout()"""
 
-from bzrlib import tests
+from bzrlib import (
+    remote,
+    tests,
+    )
 from bzrlib.tests.branch_implementations import TestCaseWithBranch
 
 
@@ -31,6 +34,18 @@
         target = source.bzrdir.sprout(self.get_url('target')).open_branch()
         self.assertEqual(source.bzrdir.root_transport.base, target.get_parent())
 
+    def test_sprout_preserves_kind(self):
+        branch1 = self.make_branch('branch1')
+        target_repo = self.make_repository('branch2')
+        target_repo.fetch(branch1.repository)
+        branch2 = branch1.sprout(target_repo.bzrdir)
+        if isinstance(branch1, remote.RemoteBranch):
+            branch1._ensure_real()
+            target_class = branch1._real_branch.__class__
+        else:
+            target_class = branch1.__class__
+        self.assertIsInstance(branch2, target_class)
+
     def test_sprout_partial(self):
         # test sprouting with a prefix of the revision-history.
         # also needs not-on-revision-history behaviour defined.



More information about the bazaar-commits mailing list