From: Aaron Bentley Date: Thu, 24 Mar 2005 16:10:44 +0000 (+0000) Subject: Added tests for assign X-Git-Tag: 1.0.0~309 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0e7c96a2fb5866f42c2c2ae7bccf47ae21f3b025;p=be.git Added tests for assign --- diff --git a/becommands/assign.py b/becommands/assign.py index ca8c647..8b80342 100644 --- a/becommands/assign.py +++ b/becommands/assign.py @@ -3,6 +3,24 @@ from libbe import bugdir, cmdutil, names __desc__ = __doc__ def execute(args): + """ + >>> from libbe import tests, names + >>> import os + >>> dir = tests.simple_bug_dir() + >>> os.chdir(dir.dir) + >>> dir.get_bug("a").assigned is None + True + >>> execute(("a",)) + >>> dir.get_bug("a").assigned == names.creator() + True + >>> execute(("a", "someone")) + >>> dir.get_bug("a").assigned + 'someone' + >>> execute(("a","none")) + >>> dir.get_bug("a").assigned is None + True + >>> tests.clean_up() + """ assert(len(args) in (0, 1, 2)) if len(args) == 0: print help()