mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
#111 Make tag.t run on any time
This commit is contained in:
parent
a8a9c8e5d6
commit
f18e105c71
1 changed files with 10 additions and 4 deletions
14
test/tag.t
14
test/tag.t
|
@ -103,7 +103,10 @@ class TestTag(TestCase):
|
||||||
four_hours_before = now - timedelta(hours=4)
|
four_hours_before = now - timedelta(hours=4)
|
||||||
five_hours_before = now - timedelta(hours=5)
|
five_hours_before = now - timedelta(hours=5)
|
||||||
|
|
||||||
exclusion = "{:%H}:00-{:%H}:00".format(four_hours_before, three_hours_before)
|
if four_hours_before.day < three_hours_before.day:
|
||||||
|
exclusion = "<{:%H}:00 >{:%H}:00".format(three_hours_before, four_hours_before)
|
||||||
|
else:
|
||||||
|
exclusion = "{:%H}:00-{:%H}:00".format(four_hours_before, three_hours_before)
|
||||||
|
|
||||||
self.t.config("exclusions.friday", exclusion)
|
self.t.config("exclusions.friday", exclusion)
|
||||||
self.t.config("exclusions.thursday", exclusion)
|
self.t.config("exclusions.thursday", exclusion)
|
||||||
|
@ -113,7 +116,7 @@ class TestTag(TestCase):
|
||||||
self.t.config("exclusions.sunday", exclusion)
|
self.t.config("exclusions.sunday", exclusion)
|
||||||
self.t.config("exclusions.saturday", exclusion)
|
self.t.config("exclusions.saturday", exclusion)
|
||||||
|
|
||||||
self.t("start {}T{:%H}:45:00 foo".format(now.date(), five_hours_before))
|
self.t("start {:%Y-%m-%dT%H}:45:00 foo".format(five_hours_before))
|
||||||
|
|
||||||
self.t("tag @2 bar")
|
self.t("tag @2 bar")
|
||||||
|
|
||||||
|
@ -186,7 +189,10 @@ class TestUntag(TestCase):
|
||||||
four_hours_before = now - timedelta(hours=4)
|
four_hours_before = now - timedelta(hours=4)
|
||||||
five_hours_before = now - timedelta(hours=5)
|
five_hours_before = now - timedelta(hours=5)
|
||||||
|
|
||||||
exclusion = "{:%H}:00-{:%H}:00".format(four_hours_before, three_hours_before)
|
if four_hours_before.day < three_hours_before.day:
|
||||||
|
exclusion = "<{:%H}:00 >{:%H}:00".format(three_hours_before, four_hours_before)
|
||||||
|
else:
|
||||||
|
exclusion = "{:%H}:00-{:%H}:00".format(four_hours_before, three_hours_before)
|
||||||
|
|
||||||
self.t.config("exclusions.friday", exclusion)
|
self.t.config("exclusions.friday", exclusion)
|
||||||
self.t.config("exclusions.thursday", exclusion)
|
self.t.config("exclusions.thursday", exclusion)
|
||||||
|
@ -196,7 +202,7 @@ class TestUntag(TestCase):
|
||||||
self.t.config("exclusions.sunday", exclusion)
|
self.t.config("exclusions.sunday", exclusion)
|
||||||
self.t.config("exclusions.saturday", exclusion)
|
self.t.config("exclusions.saturday", exclusion)
|
||||||
|
|
||||||
self.t("start {}T{:%H}:45:00 foo bar".format(now.date(), five_hours_before))
|
self.t("start {:%Y-%m-%dT%H}:45:00 foo bar".format(five_hours_before))
|
||||||
|
|
||||||
self.t("untag @2 foo")
|
self.t("untag @2 foo")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue