From 3c770f8e98a0079497d3eb5bc31e7260cc70cc63 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 22 Oct 2009 16:06:10 +0200 Subject: 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. --- test/testlib/helper.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'test/testlib') 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") -- cgit v1.2.3