All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
5 from .task import TaskWarrior
8 class TasklibTest(unittest.TestCase):
11 self.tmp = tempfile.mkdtemp()
12 self.tw = TaskWarrior(data_location=self.tmp)
15 shutil.rmtree(self.tmp)
18 class TaskFilterTest(TasklibTest):
20 def test_all_empty(self):
21 self.assertEqual(len(self.tw.tasks.all()), 0)
23 def test_all_non_empty(self):
24 self.tw.execute_command(['add', 'test task'])
25 self.assertEqual(len(self.tw.tasks.all()), 1)
26 self.assertEqual(self.tw.tasks.all()[0]['description'], 'test task')
27 self.assertEqual(self.tw.tasks.all()[0]['status'], 'pending')
29 def test_pending_non_empty(self):
30 self.tw.execute_command(['add', 'test task'])
31 self.assertEqual(len(self.tw.tasks.pending()), 1)
32 self.assertEqual(self.tw.tasks.pending()[0]['description'],
34 self.assertEqual(self.tw.tasks.pending()[0]['status'], 'pending')
36 def test_completed_empty(self):
37 self.tw.execute_command(['add', 'test task'])
38 self.assertEqual(len(self.tw.tasks.completed()), 0)
40 def test_completed_non_empty(self):
41 self.tw.execute_command(['add', 'test task'])
42 self.assertEqual(len(self.tw.tasks.completed()), 0)
43 self.tw.tasks.all()[0].done()
44 self.assertEqual(len(self.tw.tasks.completed()), 1)