aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/command/new.py
diff options
context:
space:
mode:
Diffstat (limited to 'libbe/command/new.py')
-rw-r--r--libbe/command/new.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/libbe/command/new.py b/libbe/command/new.py
index 57ff5dc..a470052 100644
--- a/libbe/command/new.py
+++ b/libbe/command/new.py
@@ -30,14 +30,15 @@ class New (libbe.command.Command):
>>> 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()
- >>> cmd._storage = bd.storage
- >>> cmd._setup_io = lambda i_enc,o_enc : None
- >>> cmd.stdout = sys.stdout
>>> uuid_gen = libbe.util.id.uuid_gen
>>> libbe.util.id.uuid_gen = lambda: 'X'
- >>> ret = cmd.run(args=['this is a test',])
+ >>> ret = ui.run(cmd, args=['this is a test',])
Created bug with ID abc/X
>>> libbe.util.id.uuid_gen = uuid_gen
>>> bd.flush_reload()
@@ -50,6 +51,7 @@ class New (libbe.command.Command):
minor
>>> print bug.status
open
+ >>> ui.cleanup()
>>> bd.cleanup()
"""
name = 'new'