mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-06-26 10:54:28 +02:00
#111 Make lengthen.t run on any time
This commit is contained in:
parent
0d2f37a806
commit
a21a12974e
1 changed files with 11 additions and 7 deletions
|
@ -77,17 +77,20 @@ class TestLengthen(TestCase):
|
|||
four_hours_before = now - timedelta(hours=4)
|
||||
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.thursday", exclusion)
|
||||
self.t.config("exclusions.wednesday", exclusion)
|
||||
self.t.config("exclusions.tuesday", exclusion)
|
||||
self.t.config("exclusions.monday", exclusion)
|
||||
self.t.config("exclusions.sunday", exclusion)
|
||||
self.t.config("exclusions.monday", exclusion)
|
||||
self.t.config("exclusions.tuesday", exclusion)
|
||||
self.t.config("exclusions.wednesday", exclusion)
|
||||
self.t.config("exclusions.thursday", exclusion)
|
||||
self.t.config("exclusions.friday", exclusion)
|
||||
self.t.config("exclusions.saturday", exclusion)
|
||||
|
||||
self.t("start {}T{:%H}:45:00".format(now.date(), five_hours_before))
|
||||
self.t("start {:%Y-%m-%dT%H}:45:00".format(five_hours_before))
|
||||
|
||||
self.t("lengthen @2 5min")
|
||||
|
||||
|
@ -106,6 +109,7 @@ class TestLengthen(TestCase):
|
|||
|
||||
# TODO Add :adjust tests.
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
from simpletap import TAPTestRunner
|
||||
unittest.main(testRunner=TAPTestRunner())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue