From bf254b70f4089de805b713124e8dc1af4eb926fb Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Thu, 26 Mar 2015 20:56:43 +0100 Subject: [PATCH] tests: Add test for simple task saving from vim --- tests/test_integration.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/test_integration.py b/tests/test_integration.py index 84b4e73..b0faec9 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -121,3 +121,20 @@ class TestViewports(IntegrationTest): "* [ ] tag work task 1 #{0}".format(self.tasks[3]['uuid']) ] + +class TestSimpleTask(IntegrationTest): + + def execute(self): + lines = ["* [ ] This is a test task"] + self.write_buffer(lines) + self.command("w") + + # Check that only one tasks with this description exists + matching = self.tw.tasks.filter(description="This is a test task") + assert len(matching) == 1 + + expected = [ + "* [ ] This is a test task #{0}".format(matching[0]['uuid']) + ] + + assert expected == self.read_buffer()