comparison tests/test_fetch_command.py @ 91:7d10165cf3d9

tests: Mock the mercurial.ui.ui class like we really should to capture output. Has the nice side effect that we can use nose 0.11's multiprocess plugin.
author Augie Fackler <durin42@gmail.com>
date Fri, 14 Nov 2008 16:52:30 -0600
parents 072010a271c6
children a3b717e4abf5
comparison
equal deleted inserted replaced
90:4c419603d41b 91:7d10165cf3d9
8 8
9 import fetch_command 9 import fetch_command
10 import test_util 10 import test_util
11 11
12 12
13 class TestBasicRepoLayout(unittest.TestCase): 13 class TestBasicRepoLayout(test_util.TestBase):
14 def setUp(self):
15 self.oldwd = os.getcwd()
16 self.tmpdir = tempfile.mkdtemp('svnwrap_test')
17 self.repo_path = '%s/testrepo' % self.tmpdir
18 self.wc_path = '%s/testrepo_wc' % self.tmpdir
19
20 def tearDown(self):
21 test_util.rmtree(self.tmpdir)
22 os.chdir(self.oldwd)
23
24 def _load_fixture_and_fetch(self, fixture_name): 14 def _load_fixture_and_fetch(self, fixture_name):
25 return test_util.load_fixture_and_fetch(fixture_name, self.repo_path, 15 return test_util.load_fixture_and_fetch(fixture_name, self.repo_path,
26 self.wc_path) 16 self.wc_path)
27 17
28 def test_fresh_fetch_single_rev(self): 18 def test_fresh_fetch_single_rev(self):
118 self.assertEqual(node.hex(repo['tip'].node()), 108 self.assertEqual(node.hex(repo['tip'].node()),
119 '9cf09e6ff7fa938188c3bcc9dd87abd7842c080c') 109 '9cf09e6ff7fa938188c3bcc9dd87abd7842c080c')
120 #'1316ef606dda89354ee8c4df725e6264177b5129') 110 #'1316ef606dda89354ee8c4df725e6264177b5129')
121 111
122 112
123 class TestStupidPull(unittest.TestCase): 113 class TestStupidPull(test_util.TestBase):
124 def setUp(self):
125 self.oldwd = os.getcwd()
126 self.tmpdir = tempfile.mkdtemp('svnwrap_test')
127 self.repo_path = '%s/testrepo' % self.tmpdir
128 self.wc_path = '%s/testrepo_wc' % self.tmpdir
129
130 def tearDown(self):
131 test_util.rmtree(self.tmpdir)
132 os.chdir(self.oldwd)
133
134 def test_stupid(self): 114 def test_stupid(self):
135 repo = test_util.load_fixture_and_fetch('two_heads.svndump', 115 repo = test_util.load_fixture_and_fetch('two_heads.svndump',
136 self.repo_path, 116 self.repo_path,
137 self.wc_path, 117 self.wc_path,
138 True) 118 True)