Test: Added simple failure in addition to SIGABRT

This commit is contained in:
Paul Beckingham 2015-08-14 11:26:40 -04:00
parent a5c722361d
commit 8eb321d8f0

View file

@ -91,21 +91,18 @@ class TestBulk(TestCase):
# Delete task 1 'one'? (yes/no/all/quit) --> timeout
code, out, err = self.t.runError("1-3 delete rc.confirmation:off", timeout=0.2)
self.tap(out)
self.tap(err)
self.assertNotIn("(yes/no)", out)
self.assertIn("(yes/no/all/quit)", out)
self.assertNotIn("Deleting task", out)
# task timeout on input - exit by signal is negative in Python
self.assertEqual(code, -signal.SIGABRT)
# Sometimes it just fails. Not sure why, but taskwarrior is behaving well.
self.assertTrue(code in [1, -signal.SIGABRT])
# Delete task 1 'one'? (yes/no/all/quit) Deleting task 1 'one'.
# Delete task 2 'two'? (yes/no/all/quit) Deleting task 2 'two'.
# Delete task 3 'three'? (yes/no/all/quit) Deleting task 3 'three'.
# Deleted 3 tasks.
code, out, err = self.t("1-3 delete rc.confirmation:off", input="y\ny\ny\n")
self.tap(out)
self.tap(err)
self.assertNotIn("(yes/no)", out)
self.assertIn("(yes/no/all/quit)", out)
self.assertIn("Deleting task 1", out)