"""Create a new bug"""
-from libbe import bugdir, cmdutil, names, utility
+from libbe import bugdir, cmdutil, names, utility, tests
def execute(args):
+ """
+ >>> import os
+ >>> dir = tests.bug_arch_dir()
+ >>> os.chdir(dir.dir)
+ >>> names.uuid = lambda: "a"
+ >>> execute (("this is a test",))
+ Created bug with ID a
+ >>> tests.clean_up()
+ """
if len(args) != 1:
raise cmdutil.UserError("Please supply a summary message")
dir = cmdutil.bug_tree()
import shutil
import os
import os.path
+from libbe import bugdir, arch
cleanable = []
def clean_up():
global cleanable
dir = Dir()
os.mkdir(os.path.join(dir.name, "{arch}"))
return dir
+
+def bug_arch_dir():
+ dir = arch_dir()
+ return bugdir.create_bug_dir(dir.name, arch)