Changeset - 1bd6ed0f38b1
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 15 years ago 2011-04-27 21:45:21
marcin@python-works.com
small fixes to test_hg_operations script
1 file changed with 10 insertions and 5 deletions:
0 comments (0 inline, 0 general)
rhodecode/tests/test_hg_operations.py
Show inline comments
 
@@ -113,13 +113,14 @@ def create_test_repo(force=True):
 

	
 
    if repo is None:
 
        print 'repo not found creating'
 

	
 
        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)
 

	
 

	
 
def set_anonymous_access(enable=True):
 
@@ -235,14 +236,15 @@ def test_push_modify_file(f_name='setup.
 

	
 
        cmd = """hg ci -m 'changed file %s' %s """ % (i, modified_file)
 
        Command(cwd).execute(cmd)
 

	
 
    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):
 

	
 
    if with_clone:
 
    test_clone(no_errors=True)
 

	
 
    cwd = path = jn(TESTS_TMP_PATH, HG_REPO)
 
    added_file = jn(path, '%ssetupążźć.py' % _RandomNameSequence().next())
 

	
 
    Command(cwd).execute('touch %s' % added_file)
 
@@ -250,13 +252,15 @@ def test_push_new_file(commits=15):
 
    Command(cwd).execute('hg add %s' % added_file)
 

	
 
    for i in xrange(commits):
 
        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' % \
 
                  {'user':USER,
 
                   'pass':PASS,
 
                   'host':HOST,
 
@@ -323,10 +327,11 @@ if __name__ == '__main__':
 
    #test_push_modify_file()
 
    #test_clone()
 
    #test_clone_anonymous_ok()
 

	
 
    #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()
0 comments (0 inline, 0 general)