diff options
author | W. Trevor King <wking@drexel.edu> | 2011-04-16 13:37:17 -0400 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2011-04-16 13:37:17 -0400 |
commit | 952a9472a66123ad7eccfa02ee5c76c11442ed0c (patch) | |
tree | c8e6e40bdb58de2f474478769fd0151d832b5ca5 /libbe/command/new.py | |
parent | 4531a4ee54aa082ebc0c73982afb122d42c8d3d1 (diff) | |
download | bugseverywhere-952a9472a66123ad7eccfa02ee5c76c11442ed0c.tar.gz |
Centralize assigned processing in parse_assigned & add assigned test to New.
Diffstat (limited to 'libbe/command/new.py')
-rw-r--r-- | libbe/command/new.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libbe/command/new.py b/libbe/command/new.py index 849eafb..763d09a 100644 --- a/libbe/command/new.py +++ b/libbe/command/new.py @@ -21,6 +21,8 @@ import libbe import libbe.command import libbe.command.util +from .assign import parse_assigned as _parse_assigned + class New (libbe.command.Command): """Create a new bug @@ -40,7 +42,8 @@ class New (libbe.command.Command): >>> uuid_gen = libbe.util.id.uuid_gen >>> libbe.util.id.uuid_gen = lambda: 'X' >>> ui._user_id = u'Fran\\xe7ois' - >>> ret = ui.run(cmd, args=['this is a test',]) + >>> options = {'assigned': 'none'} + >>> ret = ui.run(cmd, options=options, args=['this is a test',]) Created bug with ID abc/X >>> libbe.util.id.uuid_gen = uuid_gen >>> bd.flush_reload() @@ -57,6 +60,8 @@ class New (libbe.command.Command): minor >>> print bug.status open + >>> print bug.assigned + None >>> ui.cleanup() >>> bd.cleanup() """ @@ -109,12 +114,7 @@ class New (libbe.command.Command): else: bug.reporter = bug.creator if params['assigned'] != None: - assigned = params['assigned'] - if assigned == 'none': - assigned = None - elif assigned == '-': - assigned = self._get_user_id() - bug.assigned = assigned + bug.assigned = _parse_assigned(self, params['assigned']) if params['status'] != None: bug.status = params['status'] if params['severity'] != None: |