Mercurial > hgsubversion
comparison tests/test_utility_commands.py @ 236:c34abd2448b7
Issue #60: Add a svn sub-command to list all authors in a Subversion repository
| author | Daniel Tang <dytang@cs.purdue.edu> |
|---|---|
| date | Tue, 07 Apr 2009 22:15:22 -0400 |
| parents | 4c3bad24f950 |
| children | 4950b18cf949 |
comparison
equal
deleted
inserted
replaced
| 235:2969a20e0eef | 236:c34abd2448b7 |
|---|---|
| 167 u = ui.ui() | 167 u = ui.ui() |
| 168 utility_commands.generate_ignore(u, self.repo, self.wc_path) | 168 utility_commands.generate_ignore(u, self.repo, self.wc_path) |
| 169 self.assertEqual(open(os.path.join(self.wc_path, '.hgignore')).read(), | 169 self.assertEqual(open(os.path.join(self.wc_path, '.hgignore')).read(), |
| 170 '.hgignore\nsyntax:glob\nblah\notherblah\nbaz/magic\n') | 170 '.hgignore\nsyntax:glob\nblah\notherblah\nbaz/magic\n') |
| 171 | 171 |
| 172 def test_list_authors(self): | |
| 173 test_util.load_svndump_fixture(self.repo_path, | |
| 174 'replace_trunk_with_branch.svndump') | |
| 175 u = ui.ui() | |
| 176 utility_commands.list_authors(u, | |
| 177 args=[test_util.fileurl(self.repo_path)], | |
| 178 authors=None) | |
| 179 self.assertEqual(u.stream.getvalue(), 'Augie\nevil\n') | |
| 180 | |
| 181 | |
| 182 def test_list_authors_map(self): | |
| 183 test_util.load_svndump_fixture(self.repo_path, | |
| 184 'replace_trunk_with_branch.svndump') | |
| 185 author_path = os.path.join(self.repo_path, 'authors') | |
| 186 utility_commands.list_authors(ui.ui(), | |
| 187 args=[test_util.fileurl(self.repo_path)], | |
| 188 authors=author_path) | |
| 189 self.assertEqual(open(author_path).read(), 'Augie=\nevil=\n') | |
| 190 | |
| 172 | 191 |
| 173 def suite(): | 192 def suite(): |
| 174 all = [unittest.TestLoader().loadTestsFromTestCase(UtilityTests), | 193 all = [unittest.TestLoader().loadTestsFromTestCase(UtilityTests), |
| 175 ] | 194 ] |
| 176 return unittest.TestSuite(all) | 195 return unittest.TestSuite(all) |
