Mercurial > hgsubversion
diff tests/test_pull.py @ 689:35a1e93b6f78
tests: move _add_svn_rev to test_util for reuse
author | Peter Arrenbrecht <peter.arrenbrecht@gmail.com> |
---|---|
date | Wed, 08 Sep 2010 09:57:06 +0200 |
parents | 76c833526fbc |
children | b64173a27ce8 |
line wrap: on
line diff
--- a/tests/test_pull.py +++ b/tests/test_pull.py @@ -9,35 +9,12 @@ from mercurial import commands class TestPull(test_util.TestBase): def setUp(self): super(TestPull, self).setUp() - self.svn_wc = None def _load_fixture_and_fetch(self, fixture_name): return test_util.load_fixture_and_fetch(fixture_name, self.repo_path, self.wc_path, stupid=False, noupdate=False) - def _add_svn_rev(self, changes): - # changes is a dict of filename -> contents - if self.svn_wc is None: - self.svn_wc = os.path.join(self.tmpdir, 'testsvn_wc') - subprocess.call([ - 'svn', 'co', '-q', test_util.fileurl(self.repo_path), - self.svn_wc - ], - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - - for filename, contents in changes.iteritems(): - # filenames are / separated - filename = filename.replace('/', os.path.sep) - filename = os.path.join(self.svn_wc, filename) - open(filename, 'w').write(contents) - # may be redundant - subprocess.call(['svn', 'add', '-q', filename], - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - subprocess.call([ - 'svn', 'commit', '-q', self.svn_wc, '-m', 'test changes'], - stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - def test_nochanges(self): self._load_fixture_and_fetch('single_rev.svndump') state = self.repo.parents()