aboutsummaryrefslogtreecommitdiff
path: root/rhodecode/tests
diff options
context:
space:
mode:
authorMarcin Kuzminski <marcin@python-works.com>2013-03-06 14:14:57 +0100
committerMarcin Kuzminski <marcin@python-works.com>2013-03-06 14:14:57 +0100
commitb8ea6e00818ed6a21df7be68be80e2dc312d6e87 (patch)
tree71d0a5e283cc6b3c15b86dde8d3bbfb677191864 /rhodecode/tests
parentaeaeddfe05014a165e7a15ce1ac63adf52c3e4f2 (diff)
again they channged git return commands :/ and i need to fix the tests. Now running agains 1.8.1
--HG-- branch : beta
Diffstat (limited to 'rhodecode/tests')
-rwxr-xr-xrhodecode/tests/scripts/test_vcs_operations.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/rhodecode/tests/scripts/test_vcs_operations.py b/rhodecode/tests/scripts/test_vcs_operations.py
index 6fafc76e..8ac10e2a 100755
--- a/rhodecode/tests/scripts/test_vcs_operations.py
+++ b/rhodecode/tests/scripts/test_vcs_operations.py
@@ -4,10 +4,11 @@
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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
+ You must have git > 1.8.1 for tests to work fine
+
:created_on: Dec 30, 2010
:author: marcink
:copyright: (C) 2010-2012 Marcin Kuzminski <marcin@python-works.com>
@@ -107,13 +108,14 @@ def _add_files_and_push(vcs, DEST, **kwargs):
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 @@ def _add_files_and_push(vcs, DEST, **kwargs):
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 @@ class TestVCSOperations(unittest.TestCase):
#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 @@ class TestVCSOperations(unittest.TestCase):
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():