changeset 7182:736f058d6172

tests: split _add_files_and_push in two In some cases it is usefull to push the data separately. For example if a test tries to push multiple times.
author domruf <dominikruf@gmail.com>
date Thu, 25 Jan 2018 22:17:00 +0100
parents 07bf8445a393
children ba8781f3f2c2
files kallithea/tests/other/test_vcs_operations.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/tests/other/test_vcs_operations.py	Wed Feb 21 02:16:55 2018 +0100
+++ b/kallithea/tests/other/test_vcs_operations.py	Thu Jan 25 22:17:00 2018 +0100
@@ -83,8 +83,7 @@
     return tempfile.mkdtemp(dir=TESTS_TMP_PATH, prefix=prefix, suffix=suffix)
 
 
-def _add_files_and_push(webserver, vcs, dest_dir, ignoreReturnCode=False, files_no=3,
-                        clone_url=None, username=TEST_USER_ADMIN_LOGIN, password=TEST_USER_ADMIN_PASS):
+def _add_files(vcs, dest_dir, files_no=3):
     """
     Generate some files, add it to dest_dir repo and push back
     vcs is git or hg and defines what VCS we want to make those files for
@@ -115,6 +114,9 @@
         # git commit needs EMAIL on some machines
         Command(dest_dir).execute(cmd, EMAIL=email)
 
+def _add_files_and_push(webserver, vcs, dest_dir, ignoreReturnCode=False, files_no=3,
+                            clone_url=None, username=TEST_USER_ADMIN_LOGIN, password=TEST_USER_ADMIN_PASS):
+    _add_files(vcs, dest_dir, files_no=files_no)
     # PUSH it back
     _REPO = None
     if vcs == 'hg':