changeset 3480:bc7fb3e8d77e beta

again they channged git return commands :/ and i need to fix the tests. Now running agains 1.8.1
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 06 Mar 2013 14:14:57 +0100
parents b45c8916644c
children c9214877d43e
files rhodecode/tests/scripts/test_vcs_operations.py
diffstat 1 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/tests/scripts/test_vcs_operations.py	Wed Mar 06 13:52:55 2013 +0100
+++ b/rhodecode/tests/scripts/test_vcs_operations.py	Wed Mar 06 14:14:57 2013 +0100
@@ -4,9 +4,10 @@
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
     Test suite for making push/pull operations.
-    Run using::
+    Run using after doing paster serve test.ini::
+     RC_WHOOSH_TEST_DISABLE=1 RC_NO_TMP_PATH=1 nosetests rhodecode/tests/scripts/test_vcs_operations.py
 
-     RC_WHOOSH_TEST_DISABLE=1 RC_NO_TMP_PATH=1 nosetests rhodecode/tests/scripts/test_vcs_operations.py
+    You must have git > 1.8.1 for tests to work fine
 
     :created_on: Dec 30, 2010
     :author: marcink
@@ -107,13 +108,14 @@
     for i in xrange(3):
         cmd = """echo 'added_line%s' >> %s""" % (i, added_file)
         Command(cwd).execute(cmd)
+        author_str = 'Marcin Kuźminski <me@email.com>'
         if vcs == 'hg':
             cmd = """hg commit -m 'commited new %s' -u '%s' %s """ % (
-                i, 'Marcin Kuźminski <marcin@python-blog.com>', added_file
+                i, author_str, added_file
             )
         elif vcs == 'git':
             cmd = """git commit -m 'commited new %s' --author '%s' %s """ % (
-                i, 'Marcin Kuźminski <marcin@python-blog.com>', added_file
+                i, author_str, added_file
             )
         Command(cwd).execute(cmd)
     # PUSH it back
@@ -129,7 +131,7 @@
     if vcs == 'hg':
         stdout, stderr = Command(cwd).execute('hg push --verbose', clone_url)
     elif vcs == 'git':
-        stdout, stderr = Command(cwd).execute('git push', clone_url + " master")
+        stdout, stderr = Command(cwd).execute('git push --verbose', clone_url + " master")
 
     return stdout, stderr
 
@@ -324,8 +326,7 @@
         #pull fails since repo is locked
         clone_url = _construct_url(GIT_REPO)
         stdout, stderr = Command('/tmp').execute('git clone', clone_url)
-        msg = ("""423 Repository `%s` locked by user `%s`"""
-                % (GIT_REPO, TEST_USER_ADMIN_LOGIN))
+        msg = ("""The requested URL returned error: 423""")
         assert msg in stderr
 
     def test_push_on_locked_repo_by_other_user_hg(self):
@@ -455,7 +456,8 @@
             Session().commit()
             clone_url = _construct_url(GIT_REPO)
             stdout, stderr = Command('/tmp').execute('git clone', clone_url)
-            assert 'error: The requested URL returned error: 403 Forbidden' in stderr
+            msg = ("""The requested URL returned error: 403""")
+            assert msg in stderr
         finally:
             #release IP restrictions
             for ip in UserIpMap.getAll():