diff options
author | Aaron Bentley <abentley@panoramicfeedback.com> | 2005-03-24 16:42:09 +0000 |
---|---|---|
committer | Aaron Bentley <abentley@panoramicfeedback.com> | 2005-03-24 16:42:09 +0000 |
commit | 176b068f77a58d5fa4bfbec2721c6774eb4512b1 (patch) | |
tree | f13bccb3059a6ad759c06d3ce73845b3f17dff3e /becommands | |
parent | 4f1f8840a9c842efd09e7516e09f47f8e44ed844 (diff) | |
download | bugseverywhere-176b068f77a58d5fa4bfbec2721c6774eb4512b1.tar.gz |
Added tests for comments
Diffstat (limited to 'becommands')
-rw-r--r-- | becommands/comment.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/becommands/comment.py b/becommands/comment.py index 358acd2..50d58be 100644 --- a/becommands/comment.py +++ b/becommands/comment.py @@ -2,6 +2,27 @@ from libbe import bugdir, cmdutil, names, utility import os def execute(args): + """ + >>> from libbe import tests, names + >>> import os, time + >>> dir = tests.simple_bug_dir() + >>> os.chdir(dir.dir) + >>> execute(["a", "This is a comment about a"]) + >>> comment = dir.get_bug("a").list_comments()[0] + >>> comment.body + 'This is a comment about a\\n' + >>> comment.From == names.creator() + True + >>> comment.date <= int(time.time()) + True + >>> comment.in_reply_to is None + True + >>> os.environ["EDITOR"] = "echo 'I like cheese' > " + >>> execute(["b"]) + >>> dir.get_bug("b").list_comments()[0].body + 'I like cheese\\n' + >>> tests.clean_up() + """ options, args = get_parser().parse_args(args) if len(args) < 1: raise cmdutil.UsageError() |