diff tests/test_utility_commands.py @ 257:ffccf0080e54

Move wrappers for hg commands to their own module.
author Augie Fackler <durin42@gmail.com>
date Fri, 10 Apr 2009 22:38:29 -0500
parents 7932d098cb5f
children 112d57bb736e
line wrap: on
line diff
--- a/tests/test_utility_commands.py
+++ b/tests/test_utility_commands.py
@@ -8,8 +8,8 @@ from mercurial import context
 from mercurial import node
 
 import utility_commands
-import svncommands
 import test_util
+import wrappers
 
 expected_info_output = '''URL: %(repourl)s/%(branch)s
 Repository Root: %(repourl)s
@@ -65,7 +65,7 @@ class UtilityTests(test_util.TestBase):
                              {'branch': 'localbranch', })
         new = self.repo.commitctx(ctx)
         hg.update(self.repo, new)
-        utility_commands.parent(lambda x, y: None, u, self.repo, svn=True)
+        wrappers.parent(lambda x, y: None, u, self.repo, svn=True)
         self.assertEqual(u.stream.getvalue(),
                          'changeset:   3:4e256962fc5d\n'
                          'branch:      the_branch\n'
@@ -76,17 +76,17 @@ class UtilityTests(test_util.TestBase):
         hg.update(self.repo, 'default')
         # Make sure styles work
         u = ui.ui()
-        utility_commands.parent(lambda x, y: None, u, self.repo, svn=True, style='compact')
+        wrappers.parent(lambda x, y: None, u, self.repo, svn=True, style='compact')
         self.assertEqual(u.stream.getvalue(),
                          '4:1   1083037b18d8   2008-10-08 01:39 +0000   durin\n'
                          '  Add gamma on trunk.\n\n')
         # custom templates too
         u = ui.ui()
-        utility_commands.parent(lambda x, y: None, u, self.repo, svn=True, template='{node}\n')
+        wrappers.parent(lambda x, y: None, u, self.repo, svn=True, template='{node}\n')
         self.assertEqual(u.stream.getvalue(), '1083037b18d85cd84fa211c5adbaeff0fea2cd9f\n')
 
         u = ui.ui()
-        utility_commands.parent(lambda x, y: None, u, self.repo, svn=True)
+        wrappers.parent(lambda x, y: None, u, self.repo, svn=True)
         self.assertEqual(u.stream.getvalue(),
                          'changeset:   4:1083037b18d8\n'
                          'parent:      1:c95251e0dd04\n'
@@ -114,7 +114,7 @@ class UtilityTests(test_util.TestBase):
                              {'branch': 'localbranch', })
         new = self.repo.commitctx(ctx)
         hg.update(self.repo, new)
-        utility_commands.outgoing(lambda x,y,z: None, u, self.repo, svn=True)
+        wrappers.outgoing(lambda x,y,z: None, u, self.repo, svn=True)
         self.assert_(node.hex(self.repo['localbranch'].node())[:8] in
                      u.stream.getvalue())
         self.assertEqual(u.stream.getvalue(), ('changeset:   5:6de15430fa20\n'
@@ -127,7 +127,7 @@ class UtilityTests(test_util.TestBase):
                                                '\n'))
         hg.update(self.repo, 'default')
         u = ui.ui()
-        utility_commands.outgoing(lambda x,y,z: None, u, self.repo, svn=True)
+        wrappers.outgoing(lambda x,y,z: None, u, self.repo, svn=True)
         self.assertEqual(u.stream.getvalue(), 'no changes found\n')
 
     def test_url_output(self):
@@ -168,9 +168,9 @@ class UtilityTests(test_util.TestBase):
         """Verify url gets normalized on initial clone.
         """
         test_util.load_svndump_fixture(self.repo_path, 'two_revs.svndump')
-        svncommands.pull(ui.ui(),
-                         svn_url=test_util.fileurl(self.repo_path) + '/',
-                         hg_repo_path=self.wc_path, stupid=False)
+        wrappers.clone(None, ui.ui(),
+                       source=test_util.fileurl(self.repo_path) + '/',
+                       dest=self.wc_path, stupid=False)
         hg.update(self.repo, 'tip')
         u = ui.ui()
         utility_commands.url(u, self.repo, self.wc_path)
@@ -181,9 +181,9 @@ class UtilityTests(test_util.TestBase):
         """Verify url gets normalized on initial clone.
         """
         test_util.load_svndump_fixture(self.repo_path, 'ignores.svndump')
-        svncommands.pull(ui.ui(),
-                         svn_url=test_util.fileurl(self.repo_path) + '/',
-                         hg_repo_path=self.wc_path, stupid=False)
+        wrappers.clone(None, ui.ui(),
+                       source=test_util.fileurl(self.repo_path) + '/',
+                       dest=self.wc_path, stupid=False)
         hg.update(self.repo, 'tip')
         u = ui.ui()
         utility_commands.genignore(u, self.repo, self.wc_path)