comparison tests/test_externals.py @ 865:04729f3a3d17

test_util: merge load_fixture_and_fetch() into TestBase method The middle-term goal is to make TestBase repo_path and wc_path private, so they can be changed for every load call. This is not required to use nosetests multiprocess facility as the fixtures create temporary directories but it makes things much clearer and avoid weird cases where a repository was loaded several times at the same location in a single test (cf test_startrev). That way we will be more confident the tests can be parallelized. The long term goal is to make hgsubversion compatible with nosetests --processes option.
author Patrick Mezard <patrick@mezard.eu>
date Thu, 19 Apr 2012 18:29:25 +0200
parents 312b37bc5e20
children db3a651494f9
comparison
equal deleted inserted replaced
864:39d45f2190ee 865:04729f3a3d17
276 def test_mergeexternals_stupid(self): 276 def test_mergeexternals_stupid(self):
277 self.test_mergeexternals(True) 277 self.test_mergeexternals(True)
278 278
279 class TestPushExternals(test_util.TestBase): 279 class TestPushExternals(test_util.TestBase):
280 def test_push_externals(self, stupid=False): 280 def test_push_externals(self, stupid=False):
281 test_util.load_fixture_and_fetch('pushexternals.svndump', 281 repo = self._load_fixture_and_fetch('pushexternals.svndump')
282 self.repo_path,
283 self.wc_path)
284 # Add a new reference on an existing and non-existing directory 282 # Add a new reference on an existing and non-existing directory
285 changes = [ 283 changes = [
286 ('.hgsvnexternals', '.hgsvnexternals', 284 ('.hgsvnexternals', '.hgsvnexternals',
287 """[dir] 285 """[dir]
288 ../externals/project2 deps/project2 286 ../externals/project2 deps/project2
329 327
330 def test_push_hgsub(self, stupid=False): 328 def test_push_hgsub(self, stupid=False):
331 if subrepo is None: 329 if subrepo is None:
332 return 330 return
333 331
334 test_util.load_fixture_and_fetch('pushexternals.svndump', 332 self._load_fixture_and_fetch('pushexternals.svndump',
335 self.repo_path, 333 externals='subrepos')
336 self.wc_path,
337 externals='subrepos')
338 # Add a new reference on an existing and non-existing directory 334 # Add a new reference on an existing and non-existing directory
339 changes = [ 335 changes = [
340 ('.hgsub', '.hgsub', """\ 336 ('.hgsub', '.hgsub', """\
341 dir/deps/project2 = [hgsubversion] dir:^/externals/project2 deps/project2 337 dir/deps/project2 = [hgsubversion] dir:^/externals/project2 deps/project2
342 subdir1/deps/project1 = [hgsubversion] subdir1:^/externals/project1 deps/project1 338 subdir1/deps/project1 = [hgsubversion] subdir1:^/externals/project1 deps/project1