From b86c079ed585ac4eb6def4aa723143e817899029 Mon Sep 17 00:00:00 2001 From: Renato Alves Date: Fri, 10 Jul 2015 17:57:46 +0100 Subject: [PATCH] Tests: Correct bug.annotate.t Two tests were missing a task and failed for this reason. The asserts were also looking for content in the wrong stream. Stdout and stderr are not merged by default. merge_streams=True can be passed but is not recommended. --- test/bug.annotate.t | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/bug.annotate.t b/test/bug.annotate.t index 80b1569c6..f1ace4f62 100755 --- a/test/bug.annotate.t +++ b/test/bug.annotate.t @@ -45,21 +45,24 @@ class TestAnnotation(TestCase): def test_blank_annotation(self): """Verify blank annotations are prevented""" self.t("add foo") + code, out, err = self.t.runError("1 annotate") self.assertIn("Additional text must be provided", err) def test_filterless_annotate_decline(self): """Verify filterless annotation is trapped, declined""" - code, out, err = self.t.runError(("annotate", "bar"), input="no\n") + self.t("add foo") - # Fails. This output is not seen until after the "no\n" has been processed. - self.assertIn("Command prevented from running", out) + code, out, err = self.t.runError(("annotate", "bar"), input="no\n") + self.assertIn("Command prevented from running", err) + self.assertNotIn("Command prevented from running", out) def test_filterless_annotate(self): """Verify filterless annotation is trapped, overridden""" + self.t("add foo") code, out, err = self.t(("annotate", "bar"), input="yes\n") - # Fails. This output is not seen until after the "yes\n" has been processed. + self.assertNotIn("Command prevented from running", err) self.assertNotIn("Command prevented from running", out) self.assertIn("Annotated 1 task", out)