From: Tomas Babej Date: Sat, 3 Jan 2015 21:43:39 +0000 (+0100) Subject: Tests: Cover filtering by string attributes containing a space X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/commitdiff_plain/0cf64d7900cc787fd3882a66dc77fc259d2b4a56?ds=sidebyside;hp=6d756a70ec4367515bf0ec9eed7ef5b45418727d Tests: Cover filtering by string attributes containing a space --- diff --git a/tasklib/tests.py b/tasklib/tests.py index 4548df9..6d67a12 100644 --- a/tasklib/tests.py +++ b/tasklib/tests.py @@ -70,6 +70,34 @@ class TaskFilterTest(TasklibTest): no_priority_task = self.tw.tasks.get(priority=None) self.assertEqual(no_priority_task['description'], "no priority task") + def test_filter_for_task_with_space_in_descripition(self): + task = Task(self.tw, description="test task") + task.save() + + filtered_task = self.tw.tasks.get(description="test task") + self.assertEqual(filtered_task['description'], "test task") + + def test_filter_for_task_without_space_in_descripition(self): + task = Task(self.tw, description="test") + task.save() + + filtered_task = self.tw.tasks.get(description="test") + self.assertEqual(filtered_task['description'], "test") + + def test_filter_for_task_with_space_in_project(self): + task = Task(self.tw, description="test", project="random project") + task.save() + + filtered_task = self.tw.tasks.get(project="random project") + self.assertEqual(filtered_task['project'], "random project") + + def test_filter_for_task_without_space_in_project(self): + task = Task(self.tw, description="test", project="random") + task.save() + + filtered_task = self.tw.tasks.get(project="random") + self.assertEqual(filtered_task['project'], "random") + class TaskTest(TasklibTest):