Changeset - a7efcee0f399
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 15 years ago 2010-12-30 18:30:09
marcin@python-works.com
updated mercurial test operations script
1 file changed with 23 insertions and 3 deletions:
0 comments (0 inline, 0 general)
rhodecode/tests/test_hg_operations.py
Show inline comments
 
@@ -76,13 +76,13 @@ def test_push():
 

	
 
def test_push_new_file():
 
    added_file = jn(TESTS_TMP_PATH, HG_REPO, 'setup.py')
 

	
 
    __execute_cmd('touch %s' % added_file)
 

	
 
    __execute_cmd('hg addremove %s' % added_file)
 
    __execute_cmd('hg add %s' % added_file)
 

	
 
    for i in xrange(15):
 
        cmd = """echo 'added_line%s' >> %s""" % (i, added_file)
 
        __execute_cmd(cmd)
 

	
 
        cmd = """hg ci -m 'commited new %s' %s """ % (i, added_file)
 
@@ -106,13 +106,33 @@ def test_push_wrong_credentials():
 

	
 
        cmd = """hg ci -m 'commited %s' %s """ % (i, modified_file)
 
        __execute_cmd(cmd)
 

	
 
    __execute_cmd('hg push %s' % clone_url)
 

	
 
def test_push_wrong_path():
 
    added_file = jn(TESTS_TMP_PATH, HG_REPO, 'somefile.py')
 

	
 
    try:
 
        os.makedirs(jn(TESTS_TMP_PATH, HG_REPO))
 
    except OSError:
 
        pass
 

	
 
    __execute_cmd("""echo '' > %s""" % added_file)
 

	
 
    __execute_cmd("""hg add %s""" % added_file)
 

	
 
    for i in xrange(2):
 
        cmd = """echo 'added_line%s' >> %s""" % (i, added_file)
 
        __execute_cmd(cmd)
 

	
 
        cmd = """hg ci -m 'commited new %s' %s """ % (i, added_file)
 
        __execute_cmd(cmd)
 

	
 
    __execute_cmd('hg push %s' % jn(TESTS_TMP_PATH, HG_REPO + '_error'))
 

	
 
if __name__ == '__main__':
 
    test_clone()
 
    test_push_wrong_path()
 
    test_push_wrong_credentials()
 
    #test_clone()
 
    #test_push_new_file()
 
    test_push_new_file()
 

	
0 comments (0 inline, 0 general)