annotate tests/test_fetch_branches.py @ 119:ea65fe2b0856

hg_delta_editor: fix update of stray files in branches/ Ensure that self.current_file is a non-empty path in a branch.
author Patrick Mezard <pmezard@gmail.com>
date Sat, 29 Nov 2008 11:25:01 -0600
parents 3afe404042a3
children f508c1fa19a5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
117
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
1 import sys
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
2 import unittest
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
3
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
4 import test_util
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
5
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
6
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
7 class TestFetchBranches(test_util.TestBase):
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
8 def _load_fixture_and_fetch(self, fixture_name, stupid):
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
9 return test_util.load_fixture_and_fetch(fixture_name, self.repo_path,
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
10 self.wc_path, stupid=stupid)
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
11
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
12 def test_unrelatedbranch(self, stupid=False):
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
13 repo = self._load_fixture_and_fetch('unrelatedbranch.svndump', stupid)
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
14 heads = [repo[n] for n in repo.heads()]
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
15 heads = dict([(ctx.branch(), ctx) for ctx in heads])
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
16 # Let these tests disabled yet as the fix is not obvious
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
17 #self.assertEqual(heads['branch1'].manifest().keys(), ['b'])
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
18 #self.assertEqual(heads['branch2'].manifest().keys(), ['a', 'b'])
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
19
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
20 def test_unrelatedbranch_stupid(self):
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
21 self.test_unrelatedbranch(True)
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
22
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
23 def suite():
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
24 all = [unittest.TestLoader().loadTestsFromTestCase(TestFetchBranches),
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
25 ]
3afe404042a3 Add a disabled test for unrelated branches
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
26 return unittest.TestSuite(all)