Mercurial > hgsubversion
comparison svnwrap/tests/test_svnwrap.py @ 325:4f4db3d2fdbb
2.4 compat fixes.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Mon, 18 May 2009 17:09:26 -0500 |
parents | 9ad5cf45e30c |
children |
comparison
equal
deleted
inserted
replaced
324:c4061e57974c | 325:4f4db3d2fdbb |
---|---|
10 | 10 |
11 class TestBasicRepoLayout(unittest.TestCase): | 11 class TestBasicRepoLayout(unittest.TestCase): |
12 def setUp(self): | 12 def setUp(self): |
13 self.tmpdir = tempfile.mkdtemp('svnwrap_test') | 13 self.tmpdir = tempfile.mkdtemp('svnwrap_test') |
14 self.repo_path = '%s/testrepo' % self.tmpdir | 14 self.repo_path = '%s/testrepo' % self.tmpdir |
15 os.spawnvp(os.P_WAIT, 'svnadmin', ['svnadmin', 'create', | 15 os.spawnvp(os.P_WAIT, 'svnadmin', ['svnadmin', 'create', |
16 self.repo_path,]) | 16 self.repo_path,]) |
17 inp = open(os.path.join(os.path.dirname(__file__), 'fixtures', | 17 inp = open(os.path.join(os.path.dirname(__file__), 'fixtures', |
18 'project_root_at_repo_root.svndump')) | 18 'project_root_at_repo_root.svndump')) |
19 proc = subprocess.check_call(['svnadmin', 'load', self.repo_path,], | 19 proc = subprocess.call(['svnadmin', 'load', self.repo_path,], |
20 stdin=inp, close_fds=True, | 20 stdin=inp, close_fds=True, |
21 stdout=subprocess.PIPE, | 21 stdout=subprocess.PIPE, |
22 stderr=subprocess.STDOUT) | 22 stderr=subprocess.STDOUT) |
23 assert proc == 0 | |
23 self.repo = svnwrap.SubversionRepo('file://%s' % self.repo_path) | 24 self.repo = svnwrap.SubversionRepo('file://%s' % self.repo_path) |
24 | 25 |
25 def tearDown(self): | 26 def tearDown(self): |
26 shutil.rmtree(self.tmpdir) | 27 shutil.rmtree(self.tmpdir) |
27 | 28 |
55 | 56 |
56 class TestRootAsSubdirOfRepo(TestBasicRepoLayout): | 57 class TestRootAsSubdirOfRepo(TestBasicRepoLayout): |
57 def setUp(self): | 58 def setUp(self): |
58 self.tmpdir = tempfile.mkdtemp('svnwrap_test') | 59 self.tmpdir = tempfile.mkdtemp('svnwrap_test') |
59 self.repo_path = '%s/testrepo' % self.tmpdir | 60 self.repo_path = '%s/testrepo' % self.tmpdir |
60 os.spawnvp(os.P_WAIT, 'svnadmin', ['svnadmin', 'create', | 61 os.spawnvp(os.P_WAIT, 'svnadmin', ['svnadmin', 'create', |
61 self.repo_path,]) | 62 self.repo_path,]) |
62 inp = open(os.path.join(os.path.dirname(__file__), 'fixtures', | 63 inp = open(os.path.join(os.path.dirname(__file__), 'fixtures', |
63 'project_root_not_repo_root.svndump')) | 64 'project_root_not_repo_root.svndump')) |
64 subprocess.check_call(['svnadmin', 'load', self.repo_path,], | 65 ret = subprocess.call(['svnadmin', 'load', self.repo_path,], |
65 stdin=inp, close_fds=True, | 66 stdin=inp, close_fds=True, |
66 stdout=subprocess.PIPE, | 67 stdout=subprocess.PIPE, |
67 stderr=subprocess.STDOUT) | 68 stderr=subprocess.STDOUT) |
68 self.repo = svnwrap.SubversionRepo('file://%s/dummyproj' % | 69 assert ret == 0 |
70 self.repo = svnwrap.SubversionRepo('file://%s/dummyproj' % | |
69 self.repo_path) | 71 self.repo_path) |