From: Aaron Bentley Date: Thu, 24 Mar 2005 16:42:09 +0000 (+0000) Subject: Added tests for comments X-Git-Tag: 1.0.0~307 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=176b068f77a58d5fa4bfbec2721c6774eb4512b1;p=be.git Added tests for comments --- 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()