Add check whether requested intervals have been found when searching by ID

- Restores behaviour which got lost when switching to the new interval filtering in 9968b9e9
- Add test for each command

Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
This commit is contained in:
Thomas Lauf 2022-01-09 11:41:15 +01:00
parent c2e26a989e
commit 993ae85d5c
22 changed files with 329 additions and 8 deletions

View file

@ -149,6 +149,16 @@ class TestDelete(TestCase):
self.assertEqual(len(j), 0)
def test_referencing_a_non_existent_interval_is_an_error(self):
"""Calling delete with a non-existent interval reference is an error"""
code, out, err = self.t.runError("delete @1")
self.assertIn("ID '@1' does not correspond to any tracking.", err)
self.t("start 1h ago bar")
code, out, err = self.t.runError("delete @2")
self.assertIn("ID '@2' does not correspond to any tracking.", err)
if __name__ == "__main__":
from simpletap import TAPTestRunner