From 176b068f77a58d5fa4bfbec2721c6774eb4512b1 Mon Sep 17 00:00:00 2001 From: Aaron Bentley Date: Thu, 24 Mar 2005 16:42:09 +0000 Subject: Added tests for comments --- becommands/comment.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) 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() -- cgit