Mercurial > hgsubversion
comparison tests/comprehensive/test_stupid_pull.py @ 1106:5cb6c95e0283 stable
Merge default and stable so I can do stable releases again.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Tue, 11 Feb 2014 12:48:49 -0500 |
parents | cd0d14e25757 |
children | ff4e102932ed |
comparison
equal
deleted
inserted
replaced
1020:b5b1fce26f1f | 1106:5cb6c95e0283 |
---|---|
17 from hgsubversion import wrappers | 17 from hgsubversion import wrappers |
18 | 18 |
19 | 19 |
20 def _do_case(self, name, layout): | 20 def _do_case(self, name, layout): |
21 subdir = test_util.subdir.get(name, '') | 21 subdir = test_util.subdir.get(name, '') |
22 repo, repo_path = self.load_and_fetch(name, subdir=subdir, stupid=False, | 22 config = {} |
23 layout=layout) | 23 u = ui.ui() |
24 assert len(self.repo) > 0, 'Repo had no changes, maybe you need to add a subdir entry in test_util?' | 24 for branch, path in test_util.custom.get(name, {}).iteritems(): |
25 config['hgsubversionbranch.%s' % branch] = path | |
26 u.setconfig('hgsubversionbranch', branch, path) | |
27 repo, repo_path = self.load_and_fetch(name, | |
28 subdir=subdir, | |
29 layout=layout, | |
30 config=config) | |
31 assert test_util.repolen(self.repo) > 0, \ | |
32 'Repo had no changes, maybe you need to add a subdir entry in test_util?' | |
25 wc2_path = self.wc_path + '_stupid' | 33 wc2_path = self.wc_path + '_stupid' |
26 u = ui.ui() | |
27 checkout_path = repo_path | 34 checkout_path = repo_path |
28 if subdir: | 35 if subdir: |
29 checkout_path += '/' + subdir | 36 checkout_path += '/' + subdir |
30 u.setconfig('hgsubversion', 'stupid', '1') | 37 u.setconfig('hgsubversion', 'stupid', '1') |
31 u.setconfig('hgsubversion', 'layout', layout) | 38 u.setconfig('hgsubversion', 'layout', layout) |
50 name = 'test_' + case[:-len('.svndump')].replace('-', '_') | 57 name = 'test_' + case[:-len('.svndump')].replace('-', '_') |
51 # Automatic layout branchtag collision exposes a minor defect | 58 # Automatic layout branchtag collision exposes a minor defect |
52 # here, but since it isn't a regression we suppress the test case. | 59 # here, but since it isn't a regression we suppress the test case. |
53 if case != 'branchtagcollision.svndump': | 60 if case != 'branchtagcollision.svndump': |
54 attrs[name] = buildmethod(case, name, 'auto') | 61 attrs[name] = buildmethod(case, name, 'auto') |
55 name += '_single' | 62 attrs[name + '_single'] = buildmethod(case, name + '_single', 'single') |
56 attrs[name] = buildmethod(case, name, 'single') | 63 if case in test_util.custom: |
64 attrs[name + '_custom'] = buildmethod(case, name + '_custom', 'custom') | |
57 | 65 |
58 StupidPullTests = type('StupidPullTests', (test_util.TestBase,), attrs) | 66 StupidPullTests = type('StupidPullTests', (test_util.TestBase,), attrs) |
59 | |
60 | |
61 def suite(): | |
62 all_tests = [unittest.TestLoader().loadTestsFromTestCase(StupidPullTests), | |
63 ] | |
64 return unittest.TestSuite(all_tests) |