diff 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
line wrap: on
line diff
--- a/tests/test_utility_commands.py
+++ b/tests/test_utility_commands.py
@@ -169,6 +169,25 @@ class UtilityTests(test_util.TestBase):
         self.assertEqual(open(os.path.join(self.wc_path, '.hgignore')).read(),
                          '.hgignore\nsyntax:glob\nblah\notherblah\nbaz/magic\n')
 
+    def test_list_authors(self):
+        test_util.load_svndump_fixture(self.repo_path,
+                                       'replace_trunk_with_branch.svndump')
+        u = ui.ui()
+        utility_commands.list_authors(u,
+                                      args=[test_util.fileurl(self.repo_path)],
+                                      authors=None)
+        self.assertEqual(u.stream.getvalue(), 'Augie\nevil\n')
+
+
+    def test_list_authors_map(self):
+        test_util.load_svndump_fixture(self.repo_path,
+                                       'replace_trunk_with_branch.svndump')
+        author_path = os.path.join(self.repo_path, 'authors')
+        utility_commands.list_authors(ui.ui(),
+                                      args=[test_util.fileurl(self.repo_path)],
+                                      authors=author_path)
+        self.assertEqual(open(author_path).read(), 'Augie=\nevil=\n')
+        
 
 def suite():
     all = [unittest.TestLoader().loadTestsFromTestCase(UtilityTests),