From 28da7287b32e070034b8c093938effeedb2eb54e Mon Sep 17 00:00:00 2001 From: Aaron Bentley Date: Sat, 1 Apr 2006 14:14:55 -0500 Subject: Fixed test suite for the unicode switch --- becommands/assign.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'becommands/assign.py') diff --git a/becommands/assign.py b/becommands/assign.py index d682130..f3db6aa 100644 --- a/becommands/assign.py +++ b/becommands/assign.py @@ -31,7 +31,7 @@ def execute(args): True >>> execute(("a", "someone")) >>> dir.get_bug("a").assigned - 'someone' + u'someone' >>> execute(("a","none")) >>> dir.get_bug("a").assigned is None True -- cgit From 6c8b325a4a4f895c9e3a75a8316517a138ebbaba Mon Sep 17 00:00:00 2001 From: Thomas Gerigk Date: Mon, 3 Apr 2006 19:48:17 +0200 Subject: changed assign.py to look similar to those commands using get_parser()-stuff. (No, i don't really know what i'm doing |-) --- becommands/assign.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'becommands/assign.py') diff --git a/becommands/assign.py b/becommands/assign.py index f3db6aa..2308a12 100644 --- a/becommands/assign.py +++ b/becommands/assign.py @@ -37,6 +37,7 @@ def execute(args): True >>> tests.clean_up() """ + options, args = get_parser().parse_args(args) assert(len(args) in (0, 1, 2)) if len(args) == 0: print help() @@ -51,10 +52,11 @@ def execute(args): bug.assigned = args[1] bug.save() +def get_parser(): + parser = cmdutil.CmdOptionParser("be assign bug-id [assignee]") + return parser -def help(): - return """be assign bug-id [assignee] - +longhelp = """ Assign a person to fix a bug. By default, the bug is self-assigned. If an assignee is specified, the bug @@ -65,3 +67,6 @@ appears in Creator fields. To un-assign a bug, specify "none" for the assignee. """ + +def help(): + return get_parser().help_str() + longhelp -- cgit From 5d75c1f4b7362ef184276f781346e69c34bd4874 Mon Sep 17 00:00:00 2001 From: Aaron Bentley Date: Tue, 4 Apr 2006 19:52:25 -0400 Subject: Fixed tests to use lists, so that optparse can mangle them --- becommands/assign.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'becommands/assign.py') diff --git a/becommands/assign.py b/becommands/assign.py index 2308a12..d7c2fca 100644 --- a/becommands/assign.py +++ b/becommands/assign.py @@ -26,13 +26,13 @@ def execute(args): >>> os.chdir(dir.dir) >>> dir.get_bug("a").assigned is None True - >>> execute(("a",)) + >>> execute(["a",]) >>> dir.get_bug("a").assigned == names.creator() True - >>> execute(("a", "someone")) + >>> execute(["a", "someone"]) >>> dir.get_bug("a").assigned u'someone' - >>> execute(("a","none")) + >>> execute(["a","none"]) >>> dir.get_bug("a").assigned is None True >>> tests.clean_up() -- cgit