mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
Fix time values in tests
This commit is contained in:
parent
706ad0b7f4
commit
89d59e3363
3 changed files with 15 additions and 12 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -51,6 +51,7 @@ from basetest import Timew, TestCase
|
|||
# self.assertNotRegexpMatches(text, pattern)
|
||||
# self.tap("")
|
||||
|
||||
|
||||
class TestStart(TestCase):
|
||||
def setUp(self):
|
||||
"""Executed before each test in the class"""
|
||||
|
|
|
@ -72,8 +72,10 @@ class TestTags(TestCase):
|
|||
def test_tags_filtered(self):
|
||||
"""Test that tags command filtering excludes tags that are outside the filter range"""
|
||||
self.t("track 20160101T0100 - 20160101T1000 foo")
|
||||
self.t("track 9am - 11am bar")
|
||||
code, out, err = self.t("tags :week")
|
||||
# self.t("track 9am - 11am bar")
|
||||
# code, out, err = self.t("tags :week")
|
||||
self.t("track 20160104T0100 - 20160104T1000 bar")
|
||||
code, out, err = self.t("tags 2016-01-02 - 2016-01-06")
|
||||
self.assertNotIn('foo', out)
|
||||
self.assertIn('bar', out)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue