Mercurial > hgsubversion
comparison tests/test_util.py @ 138:40474f6c1f84
diff_cmd: more robust, add tests.
| author | Augie Fackler <durin42@gmail.com> |
|---|---|
| date | Thu, 11 Dec 2008 19:49:36 -0600 |
| parents | e58c2f1de059 |
| children | 89a737852d33 |
comparison
equal
deleted
inserted
replaced
| 137:904a4b08f70f | 138:40474f6c1f84 |
|---|---|
| 78 self.stream.write(*args) | 78 self.stream.write(*args) |
| 79 | 79 |
| 80 def warn(self, *args): | 80 def warn(self, *args): |
| 81 self.stream.write(*args) | 81 self.stream.write(*args) |
| 82 | 82 |
| 83 def write(self, *args): | |
| 84 self.stream.write(*args) | |
| 85 | |
| 83 def __getattr__(self, attr): | 86 def __getattr__(self, attr): |
| 84 return getattr(self.inner_ui, attr) | 87 return getattr(self.inner_ui, attr) |
| 85 | 88 |
| 86 | 89 |
| 87 class TestBase(unittest.TestCase): | 90 class TestBase(unittest.TestCase): |
| 95 | 98 |
| 96 def tearDown(self): | 99 def tearDown(self): |
| 97 rmtree(self.tmpdir) | 100 rmtree(self.tmpdir) |
| 98 os.chdir(self.oldwd) | 101 os.chdir(self.oldwd) |
| 99 ui.ui = self._real_ui | 102 ui.ui = self._real_ui |
| 103 | |
| 104 def _load_fixture_and_fetch(self, fixture_name, subdir='', stupid=False): | |
| 105 return load_fixture_and_fetch(fixture_name, self.repo_path, | |
| 106 self.wc_path, subdir=subdir, | |
| 107 stupid=stupid) | |
| 100 | 108 |
| 101 # define this as a property so that it reloads anytime we need it | 109 # define this as a property so that it reloads anytime we need it |
| 102 @property | 110 @property |
| 103 def repo(self): | 111 def repo(self): |
| 104 return hg.repository(ui.ui(), self.wc_path) | 112 return hg.repository(ui.ui(), self.wc_path) |
