Changeset - bc7fb3e8d77e
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2013-03-06 14:14:57
marcin@python-works.com
again they channged git return commands :/ and i need to fix the tests. Now running agains 1.8.1
1 file changed with 10 insertions and 8 deletions:
0 comments (0 inline, 0 general)
rhodecode/tests/scripts/test_vcs_operations.py
Show inline comments
 
@@ -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 @@ def _add_files_and_push(vcs, DEST, **kwa
 
    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, **kwa
 
    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.TestCas
 
        #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.TestCas
 
            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():
0 comments (0 inline, 0 general)