X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/2613912534bba4a68e19a76752971ac75063654b..fcd3eb3f048c5d722757429345d1b99b343a43f6:/tasklib/tests.py diff --git a/tasklib/tests.py b/tasklib/tests.py index ca2ff4a..5a8f576 100644 --- a/tasklib/tests.py +++ b/tasklib/tests.py @@ -81,6 +81,30 @@ class TaskFilterTest(TasklibTest): self.tw.tasks.all()[0].done() self.assertEqual(len(self.tw.tasks.completed()), 1) + def test_deleted_empty(self): + Task(self.tw, description="test task").save() + self.assertEqual(len(self.tw.tasks.deleted()), 0) + + def test_deleted_non_empty(self): + Task(self.tw, description="test task").save() + self.assertEqual(len(self.tw.tasks.deleted()), 0) + self.tw.tasks.all()[0].delete() + self.assertEqual(len(self.tw.tasks.deleted()), 1) + + def test_waiting_empty(self): + Task(self.tw, description="test task").save() + self.assertEqual(len(self.tw.tasks.waiting()), 0) + + def test_waiting_non_empty(self): + Task(self.tw, description="test task").save() + self.assertEqual(len(self.tw.tasks.waiting()), 0) + + t = self.tw.tasks.all()[0] + t['wait'] = datetime.datetime.now() + datetime.timedelta(days=1) + t.save() + + self.assertEqual(len(self.tw.tasks.waiting()), 1) + def test_filtering_by_attribute(self): Task(self.tw, description="no priority task").save() Task(self.tw, priority="H", description="high priority task").save()