X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/a12e28c3cef94409801bea964ccc1e3db677a0cf..272ac3f6ece5a39abfa20d1da3dceb48be4685f6:/tasklib/tests.py diff --git a/tasklib/tests.py b/tasklib/tests.py index b33fd59..b6e3adc 100644 --- a/tasklib/tests.py +++ b/tasklib/tests.py @@ -284,6 +284,11 @@ class TaskTest(TasklibTest): self.assertRaises(Task.CompletedTask, t.start) + def test_add_completed_task(self): + t = Task(self.tw, description="test", status="completed", + end=datetime.datetime.now()) + t.save() + def test_complete_deleted_task(self): t = Task(self.tw, description="test task") t.save() @@ -330,6 +335,12 @@ class TaskTest(TasklibTest): t.save() self.assertFalse(t.active) + def test_start_active_task(self): + t = Task(self.tw, description="test task") + t.save() + t.start() + self.assertRaises(Task.ActiveTask, t.start) + def test_stop_completed_task(self): t = Task(self.tw, description="test task") t.save() @@ -739,6 +750,7 @@ class TaskFromHookTest(TasklibTest): '{"description":"Buy some milk",' '"entry":"20141118T050231Z",' '"status":"pending",' + '"start":"20141119T152233Z",' '"uuid":"a360fc44-315c-4366-b70c-ea7e7520b749"}') input_modify_data = six.StringIO(input_add_data.getvalue() + '\n' + @@ -767,7 +779,7 @@ class TaskFromHookTest(TasklibTest): self.assertEqual(t._original_data['status'], "pending") self.assertEqual(t._original_data['description'], "Buy some milk") self.assertEqual(set(t._modified_fields), - set(['status', 'description'])) + set(['status', 'description', 'start'])) def test_export_data(self): t = Task(self.tw, description="test task",