Added tests for assign
authorAaron Bentley <abentley@panoramicfeedback.com>
Thu, 24 Mar 2005 16:10:44 +0000 (16:10 +0000)
committerAaron Bentley <abentley@panoramicfeedback.com>
Thu, 24 Mar 2005 16:10:44 +0000 (16:10 +0000)
becommands/assign.py

index ca8c647b73c9362b5fb7b0d7b649313eacd5c6b0..8b80342fc375a8f68883eb56a45fb42fbcbc5fb2 100644 (file)
@@ -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()