mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
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.
This commit is contained in:
parent
5eaf09759e
commit
b86c079ed5
1 changed files with 7 additions and 4 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue