mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-25 12:17:20 +02:00
TW-1634: due.not:<date> excludes only tasks scheduled at mitnight
- Thanks to Tomas Babej.
This commit is contained in:
parent
d18a46da01
commit
7ee8ad4e44
3 changed files with 34 additions and 26 deletions
|
@ -40,44 +40,45 @@ class Test1634(TestCase):
|
|||
self.t = Task()
|
||||
|
||||
# Setup some tasks due on 2015-07-07
|
||||
self.t('add due:2015-07-07T00:00:00 on due date 1')
|
||||
self.t('add due:2015-07-07T08:00:00 on due date 2')
|
||||
self.t('add due:2015-07-07T14:34:56 on due date 3')
|
||||
self.t('add due:2015-07-07T22:00:00 on due date 4')
|
||||
self.t('add due:2015-07-07T23:59:59 on due date 5')
|
||||
self.t('add due:2015-07-07T00:00:00 ON1')
|
||||
self.t('add due:2015-07-07T14:34:56 ON2')
|
||||
self.t('add due:2015-07-07T23:59:59 ON3')
|
||||
|
||||
# Setup some tasks not due on 2015-07-07
|
||||
self.t('add due:2015-07-06T23:59:59 not on due date 1')
|
||||
self.t('add due:2015-07-08T00:00:00 not on due date 2')
|
||||
self.t('add due:2015-07-08T00:00:01 not on due date 3')
|
||||
self.t('add due:2015-07-06T00:00:00 not on due date 4')
|
||||
|
||||
self.t('add due:2015-07-06T23:59:59 OFF4')
|
||||
self.t('add due:2015-07-08T00:00:00 OFF5')
|
||||
self.t('add due:2015-07-08T00:00:01 OFF6')
|
||||
self.t('add due:2015-07-06T00:00:00 OFF7')
|
||||
|
||||
def test_due_match_not_exact(self):
|
||||
"""Test that due:<date> matches any task that date."""
|
||||
|
||||
code, out, err = self.t('due:2015-07-07 minimal')
|
||||
|
||||
# Assert that each task on 2015-07-07 is listed
|
||||
for i in range(1,5):
|
||||
self.assertIn("on due date {0}".format(i), out)
|
||||
# Asswer that only tasks ON the date are listed.
|
||||
self.assertIn("ON1", out)
|
||||
self.assertIn("ON2", out)
|
||||
self.assertIn("ON3", out)
|
||||
|
||||
# Assert that no task not on 2015-07-07 is not listed
|
||||
for i in range(1,4):
|
||||
self.assertNotIn("not on due date {0}".format(i), out)
|
||||
# Assert that tasks on other dates are not listed.
|
||||
self.assertNotIn("OFF4", out)
|
||||
self.assertNotIn("OFF5", out)
|
||||
self.assertNotIn("OFF6", out)
|
||||
self.assertNotIn("OFF7", out)
|
||||
|
||||
def test_due_not_match_not_exact(self):
|
||||
"""Test that due.not:<date> does not match any task that date."""
|
||||
|
||||
code, out, err = self.t('due.not:2015-07-07 minimal')
|
||||
|
||||
# Assert that every task not on 2015-07-07 is listed
|
||||
for i in range(1,4):
|
||||
self.assertIn("not on due date {0}".format(i), out)
|
||||
# Assert that task ON the date are not listed.
|
||||
self.assertNotIn("ON1", out)
|
||||
self.assertNotIn("ON2", out)
|
||||
self.assertNotIn("ON3", out)
|
||||
|
||||
# Assert that each task on 2015-07-07 is listed
|
||||
for i in range(1,5):
|
||||
self.assertNotIn("on due date {0}".format(i), out)
|
||||
# Assert that tasks on other dates are listed.
|
||||
self.assertIn("OFF4", out)
|
||||
self.assertIn("OFF5", out)
|
||||
self.assertIn("OFF6", out)
|
||||
self.assertIn("OFF7", out)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue