summaryrefslogtreecommitdiff
path: root/test/testlib/helper.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-10-22 16:06:10 +0200
committerSebastian Thiel <byronimo@gmail.com>2009-10-22 16:06:51 +0200
commit3c770f8e98a0079497d3eb5bc31e7260cc70cc63 (patch)
tree9ccea0ef524e5a0fc928be6b89e3a7071471111d /test/testlib/helper.py
parent9c3bbc43d097656b54c808290ce0c656d127ce47 (diff)
downloadgitpython-3c770f8e98a0079497d3eb5bc31e7260cc70cc63.tar.gz
Fixed decorator issue that would cause a function to be passed even though there is a default argument. This feels inconsistent as the 'argument passer' wrapper function can be called with a function or a string as first argument depending on whether the client code was explicitly passing an argument or not. That ... sucks. Now test for that case specifically and fail with a proper assertion error. I don't like it, but what can I do ... .
Remote tests adjusted to use rw repositories instead. More tests to follow, and many api methods are to be implemented now these things can be tested properly.
Diffstat (limited to 'test/testlib/helper.py')
-rw-r--r--test/testlib/helper.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/testlib/helper.py b/test/testlib/helper.py
index c4fccbf6..eef7876f 100644
--- a/test/testlib/helper.py
+++ b/test/testlib/helper.py
@@ -88,13 +88,14 @@ def with_bare_rw_repo(func):
bare_repo_creator.__name__ = func.__name__
return bare_repo_creator
-def with_rw_repo(working_tree_ref='0.1.6'):
+def with_rw_repo(working_tree_ref):
"""
Same as with_bare_repo, but clones the rorepo as non-bare repository, checking
out the working tree at the given working_tree_ref.
This repository type is more costly due to the working copy checkout.
"""
+ assert isinstance(working_tree_ref, basestring), "Decorator requires ref name for working tree checkout"
def argument_passer(func):
def repo_creator(self):
repo_dir = tempfile.mktemp("non_bare_repo")
@@ -111,7 +112,7 @@ def with_rw_repo(working_tree_ref='0.1.6'):
# END argument passer
return argument_passer
-def with_rw_and_rw_remote_repo(working_tree_ref='0.1.6'):
+def with_rw_and_rw_remote_repo(working_tree_ref):
"""
Same as with_rw_repo, but also provides a writable remote repository from which the
rw_repo has been forked. The remote repository was cloned as bare repository from
@@ -125,6 +126,7 @@ def with_rw_and_rw_remote_repo(working_tree_ref='0.1.6'):
This setup allows you to test push and pull scenarios and hooks nicely.
"""
+ assert isinstance(working_tree_ref, basestring), "Decorator requires ref name for working tree checkout"
def argument_passer(func):
def remote_repo_creator(self):
remote_repo_dir = tempfile.mktemp("remote_repo")