changeset 1296:1bd6ed0f38b1 beta

small fixes to test_hg_operations script
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 27 Apr 2011 21:45:21 +0200
parents 11548cc19c8f
children d87997ed6ef1
files rhodecode/tests/test_hg_operations.py
diffstat 1 files changed, 11 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/tests/test_hg_operations.py	Wed Apr 27 20:16:03 2011 +0200
+++ b/rhodecode/tests/test_hg_operations.py	Wed Apr 27 21:45:21 2011 +0200
@@ -116,7 +116,8 @@
 
         form_data = {'repo_name':HG_REPO,
                      'repo_type':'hg',
-                     'private':False, }
+                     'private':False,
+                     'clone_uri':'' }
         rm = RepoModel(sa)
         rm.base_path = '/home/hg'
         rm.create(form_data, user)
@@ -238,9 +239,10 @@
 
     Command(cwd).execute('hg push %s' % jn(TESTS_TMP_PATH, HG_REPO))
 
-def test_push_new_file(commits=15):
+def test_push_new_file(commits=15, with_clone=True):
 
-    test_clone(no_errors=True)
+    if with_clone:
+        test_clone(no_errors=True)
 
     cwd = path = jn(TESTS_TMP_PATH, HG_REPO)
     added_file = jn(path, '%ssetupążźć.py' % _RandomNameSequence().next())
@@ -253,7 +255,9 @@
         cmd = """echo 'added_line%s' >> %s""" % (i, added_file)
         Command(cwd).execute(cmd)
 
-        cmd = """hg ci -m 'commited new %s' %s """ % (i, added_file)
+        cmd = """hg ci -m 'commited new %s' -u '%s' %s """ % (i,
+                                'Marcin Kuźminski <marcin@python-blog.com>',
+                                added_file)
         Command(cwd).execute(cmd)
 
     push_url = 'http://%(user)s:%(pass)s@%(host)s/%(cloned_repo)s' % \
@@ -326,7 +330,8 @@
 
     #test_clone_wrong_credentials()
 
-    #test_pull()
-    test_push_new_file(commits=15)
+    test_pull()
+    test_push_new_file(commits=2, with_clone=True)
+
     #test_push_wrong_path()
     #test_push_wrong_credentials()