From 228ef69b3f641c8bb81d7377977b9b57855f8572 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Fri, 2 Jan 2015 06:23:30 +0100 Subject: [PATCH] Tests: Adds tests for adding attributes with spaces --- tasklib/tests.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tasklib/tests.py b/tasklib/tests.py index 8103562..72aebb9 100644 --- a/tasklib/tests.py +++ b/tasklib/tests.py @@ -114,6 +114,29 @@ class TaskTest(TasklibTest): self.assertRaises(Task.DeletedTask, t.done) + def test_modify_simple_attribute_without_space(self): + t = Task(self.tw, description="test") + t.save() + + self.assertEquals(t['description'], "test") + + t['description'] = "test-modified" + t.save() + + self.assertEquals(t['description'], "test-modified") + + def test_modify_simple_attribute_with_space(self): + # Space can pose problems with parsing + t = Task(self.tw, description="test task") + t.save() + + self.assertEquals(t['description'], "test task") + + t['description'] = "test task modified" + t.save() + + self.assertEquals(t['description'], "test task modified") + def test_empty_dependency_set_of_unsaved_task(self): t = Task(self.tw, description="test task") self.assertEqual(t['depends'], set()) -- 2.39.5