Fix time values in tests

This commit is contained in:
Thomas Lauf 2017-04-06 22:07:04 +02:00
parent 706ad0b7f4
commit 89d59e3363
3 changed files with 15 additions and 12 deletions

View file

@ -64,7 +64,7 @@ class TestContinue(TestCase):
def test_continue_open(self):
"""Verify that continuing an open interval is an error"""
code, out, err = self.t("start tag1 tag2")
code, out, err = self.t("start tag1 tag2 1h ago")
self.assertIn("Tracking tag1 tag2\n", out)
code, out, err = self.t.runError("continue")
@ -72,7 +72,7 @@ class TestContinue(TestCase):
def test_continue_closed(self):
"""Verify that continuing a closed interval works"""
code, out, err = self.t("start tag1 tag2")
code, out, err = self.t("start tag1 tag2 1h ago")
self.assertIn("Tracking tag1 tag2\n", out)
code, out, err = self.t("stop")
@ -88,17 +88,20 @@ class TestContinue(TestCase):
def test_continue_with_invalid_id(self):
"""Verify that 'continue' with invalid id is an error"""
code, out, err = self.t.runError("continue @1")
self.assertIn("ID '@1' does not correspond to any tracking.\n", err)
code, out, err = self.t("start FOO 1h ago")
self.assertIn("Tracking FOO\n", out)
code, out, err = self.t("stop 30min ago")
self.assertIn("Tracking BAR\n", out)
code, out, err = self.t.runError("continue @4")
self.assertIn("ID '@4' does not correspond to any tracking.\n", err)
def test_continue_with_id_without_active_tracking(self):
"""Verify that continuing a specified interval works"""
code, out, err = self.t("start FOO 1h ago")
self.assertIn("Tracking FOO\n", out)
code, out, err = self.t("stop 30min ago")
self.assertIn("Recorded FOO\n", out)
code, out, err = self.t("start BAR 30min ago")
self.assertIn("Tracking BAR\n", out)
@ -113,9 +116,6 @@ class TestContinue(TestCase):
code, out, err = self.t("start FOO 1h ago")
self.assertIn("Tracking FOO\n", out)
code, out, err = self.t("stop 30min ago")
self.assertIn("Recorded FOO\n", out)
code, out, err = self.t("start BAR 30min ago")
self.assertIn("Tracking BAR\n", out)