From 657ce905f5195b1c98509b64560c3d89a4fa0bec Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 20 Nov 2014 12:25:12 +0100 Subject: [PATCH] tests: populating svn failed, was using wrong paths now all 6 tests pass --- tests/test_cli.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index 66a75e5..b1c6ee7 100755 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -193,13 +193,18 @@ def svn_repo_checkout(repo, path): def svn_repo_populate(path): - dummy_file = os.path.join(path, "file1") - file_quick_touch(path) + if not os.path.exists(path): + os.makedirs(path) - if not run_check(["svn", "add", dummy_file]): + # TODO, we probably want to define files externally, for now this is just to see it works + dummy_file = os.path.join(path, "file1") + file_quick_touch(dummy_file) + + # adds all files recursively + if not run_check(["svn", "add", path]): return False - if not run_check(["svn", "commit", "-m", "First commit"]): + if not run_check(["svn", "commit", "-m", "First commit"], path): return False return True @@ -341,6 +346,7 @@ def global_setup(): del logging shutil.rmtree(TEMP_SERVER, ignore_errors=True) + shutil.rmtree(TEMP, ignore_errors=True) p = server() data = p return data @@ -349,7 +355,7 @@ def global_setup(): def global_teardown(data): p = data p.terminate() - shutil.rmtree(TEMP_SERVER, ignore_errors=True) + shutil.rmtree(TEMP, ignore_errors=True) # ------------------------------------------------------------------------------