From 96fb17929bd52d58a8f760eab98265824ac5dce3 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Sat, 26 Dec 2015 14:59:48 +0100 Subject: [PATCH] tests: Expand tests for LazyUUIDTask --- tasklib/tests.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tasklib/tests.py b/tasklib/tests.py index fc0a1c1..a77058a 100644 --- a/tasklib/tests.py +++ b/tasklib/tests.py @@ -1118,10 +1118,20 @@ class LazyUUIDTaskTest(TasklibTest): assert self.stored['uuid'] == self.lazy['uuid'] assert type(self.lazy) is LazyUUIDTask - def test_conversion(self): + def test_lazy_explicit_conversion(self): + assert type(self.lazy) is LazyUUIDTask + self.lazy.replace() + assert type(self.lazy) is Task + + def test_conversion_key(self): assert self.stored['description'] == self.lazy['description'] assert type(self.lazy) is Task + def test_conversion_attribute(self): + assert type(self.lazy) is LazyUUIDTask + assert self.lazy.completed is False + assert type(self.lazy) is Task + def test_normal_to_lazy_equality(self): assert self.stored == self.lazy assert type(self.lazy) is LazyUUIDTask @@ -1140,6 +1150,15 @@ class LazyUUIDTaskTest(TasklibTest): assert self.lazy in tasks assert type(self.lazy) is LazyUUIDTask + def test_lazy_saved(self): + assert self.lazy.saved is True + + def test_lazy_modified(self): + assert self.lazy.modified is False + + def test_lazy_modified_fields(self): + assert self.lazy._modified_fields == set() + class LazyUUIDTaskSetTest(TasklibTest): -- 2.39.5