]> git.madduck.net Git - etc/taskwarrior.git/commitdiff

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

tests: Expand tests for LazyUUIDTask
authorTomas Babej <tomasbabej@gmail.com>
Sat, 26 Dec 2015 13:59:48 +0000 (14:59 +0100)
committerTomas Babej <tomasbabej@gmail.com>
Sat, 26 Dec 2015 14:44:29 +0000 (15:44 +0100)
tasklib/tests.py

index fc0a1c174e622f637e4afb9ffbb5969981fb1323..a77058ab13c59a96f8f3a7c909b7082c14704209 100644 (file)
@@ -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):