changeset 897:a7efcee0f399 beta

updated mercurial test operations script
author Marcin Kuzminski <marcin@python-works.com>
date Thu, 30 Dec 2010 18:30:09 +0100
parents af65ca7e5c2b
children 9c4851dce8e6
files rhodecode/tests/test_hg_operations.py
diffstat 1 files changed, 23 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/tests/test_hg_operations.py	Thu Dec 30 18:14:37 2010 +0100
+++ b/rhodecode/tests/test_hg_operations.py	Thu Dec 30 18:30:09 2010 +0100
@@ -79,7 +79,7 @@
 
     __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)
@@ -109,10 +109,30 @@
 
     __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()