From 7da15db25fe27b27780cae6df713f49e2218729e Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Sun, 27 Dec 2015 18:41:59 +0100 Subject: [PATCH] tests Add test for loading task not present in TW --- tests/test_vwtask.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/tests/test_vwtask.py b/tests/test_vwtask.py index 92a35de..413de58 100644 --- a/tests/test_vwtask.py +++ b/tests/test_vwtask.py @@ -26,6 +26,27 @@ class TestSimpleTaskCreation(IntegrationTest): assert task['status'] == 'pending' +class TestInvalidUUIDTask(IntegrationTest): + + viminput = """ + * [ ] This is a test task #abc123ef + """ + + vimoutput = """ + * [ ] This is a test task #{uuid} + """ + + def execute(self): + self.command("w", regex="on line 1 will be re-created") + + # Check that only one tasks with this description exists + assert len(self.tw.tasks.pending()) == 1 + + task = self.tw.tasks.pending()[0] + assert task['description'] == 'This is a test task' + assert task['status'] == 'pending' + + class TestSimpleTaskModification(IntegrationTest): viminput = """