diff tests/test_fetch_branches.py @ 278:60acc38eac96

clone: prefer tip of default to overall tip when updating
author Martijn Pieters <mj@zopatista.com>
date Fri, 24 Apr 2009 20:36:38 -0500
parents c0063328587f
children f8f9a2993705
line wrap: on
line diff
--- a/tests/test_fetch_branches.py
+++ b/tests/test_fetch_branches.py
@@ -6,9 +6,10 @@ import test_util
 
 
 class TestFetchBranches(test_util.TestBase):
-    def _load_fixture_and_fetch(self, fixture_name, stupid):
+    def _load_fixture_and_fetch(self, fixture_name, stupid, noupdate=True):
         return test_util.load_fixture_and_fetch(fixture_name, self.repo_path,
-                                                self.wc_path, stupid=stupid)
+                                                self.wc_path, stupid=stupid,
+                                                noupdate=noupdate)
 
     def test_unrelatedbranch(self, stupid=False):
         repo = self._load_fixture_and_fetch('unrelatedbranch.svndump', stupid)
@@ -59,6 +60,15 @@ class TestFetchBranches(test_util.TestBa
         self.assertEqual(repo['tip'].manifest().keys(),
                          ['alpha', 'beta', 'iota', 'gamma', ])
 
+    def test_branch_tip_update_to_default(self, stupid=False):
+        repo = self._load_fixture_and_fetch('unorderedbranch.svndump',
+                                            stupid, noupdate=False)
+        self.assertEqual(repo[None].branch(), 'default')
+        self.assertTrue('tip' not in repo[None].tags())
+    
+    def test_branch_tip_update_to_default_stupid(self):
+        self.test_branch_tip_update_to_default(True)
+
 def suite():
     all = [unittest.TestLoader().loadTestsFromTestCase(TestFetchBranches),
           ]