aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/command/due.py
diff options
context:
space:
mode:
Diffstat (limited to 'libbe/command/due.py')
-rw-r--r--libbe/command/due.py20
1 files changed, 11 insertions, 9 deletions
diff --git a/libbe/command/due.py b/libbe/command/due.py
index f3ad2f1..2eb3194 100644
--- a/libbe/command/due.py
+++ b/libbe/command/due.py
@@ -29,19 +29,21 @@ class Due (libbe.command.Command):
>>> import sys
>>> import libbe.bugdir
>>> bd = libbe.bugdir.SimpleBugDir(memory=False)
- >>> cmd = Due()
- >>> cmd._storage = bd.storage
- >>> cmd._setup_io = lambda i_enc,o_enc : None
- >>> cmd.stdout = sys.stdout
+ >>> io = libbe.command.StringInputOutput()
+ >>> io.stdout = sys.stdout
+ >>> ui = libbe.command.UserInterface(io=io)
+ >>> ui.storage_callbacks.set_storage(bd.storage)
+ >>> cmd = Due(ui=ui)
- >>> ret = cmd.run(args=['/a'])
+ >>> ret = ui.run(cmd, args=['/a'])
No due date assigned.
- >>> ret = cmd.run(args=['/a', 'Thu, 01 Jan 1970 00:00:00 +0000'])
- >>> ret = cmd.run(args=['/a'])
+ >>> ret = ui.run(cmd, args=['/a', 'Thu, 01 Jan 1970 00:00:00 +0000'])
+ >>> ret = ui.run(cmd, args=['/a'])
Thu, 01 Jan 1970 00:00:00 +0000
- >>> ret = cmd.run(args=['/a', 'none'])
- >>> ret = cmd.run(args=['/a'])
+ >>> ret = ui.run(cmd, args=['/a', 'none'])
+ >>> ret = ui.run(cmd, args=['/a'])
No due date assigned.
+ >>> ui.cleanup()
>>> bd.cleanup()
"""
name = 'due'