Create a new bug
>>> import os
>>> import sys
>>> import time
>>> import libbe.bugdir
>>> import libbe.util.id
>>> bd = libbe.bugdir.SimpleBugDir(memory=False)
>>> io = libbe.command.StringInputOutput()
>>> io.stdout = sys.stdout
>>> ui = libbe.command.UserInterface(io=io)
>>> ui.storage_callbacks.set_storage(bd.storage)
>>> cmd = New()
>>> uuid_gen = libbe.util.id.uuid_gen
>>> libbe.util.id.uuid_gen = lambda: 'X'
>>> ui._user_id = u'Fran\xe7ois'
>>> 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()
>>> bug = bd.bug_from_uuid('X')
>>> print bug.summary
this is a test
>>> bug.creator
u'Fran\xe7ois'
>>> bug.reporter
u'Fran\xe7ois'
>>> bug.time <= int(time.time())
True
>>> print bug.severity
minor
>>> print bug.status
open
>>> print bug.assigned
None
>>> ui.cleanup()
>>> bd.cleanup()
Methods
cleanup() | |
complete([argument, fragment]) | |
help(*args) | |
run([options, args]) | |
usage() |