]> git.madduck.net Git - etc/taskwarrior.git/blobdiff - tasklib/tests.py

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: Replace key with different config keys that are more consistent across versions
[etc/taskwarrior.git] / tasklib / tests.py
index 77f1980f918aec78a008f885e276d2892b02108b..3e60ac013376fc571c0c8d2f66db613f5c948ed9 100644 (file)
@@ -614,6 +614,23 @@ class TaskTest(TasklibTest):
         t2 = self.tw.tasks.get(uuid=t1['uuid'])
         self.assertEqual(t1.__hash__(), t2.__hash__())
 
+    def test_hash_unequal_unsaved_tasks(self):
+        # Compare the hash of the task using two different objects
+        t1 = Task(self.tw, description="test task 1")
+        t2 = Task(self.tw, description="test task 2")
+
+        self.assertNotEqual(t1.__hash__(), t2.__hash__())
+
+    def test_hash_unequal_saved_tasks(self):
+        # Compare the hash of the task using two different objects
+        t1 = Task(self.tw, description="test task 1")
+        t2 = Task(self.tw, description="test task 2")
+
+        t1.save()
+        t2.save()
+
+        self.assertNotEqual(t1.__hash__(), t2.__hash__())
+
     def test_adding_task_with_priority(self):
         t = Task(self.tw, description="test task", priority="M")
         t.save()
@@ -1359,4 +1376,5 @@ class TaskWarriorBackendTest(TasklibTest):
 
     def test_config(self):
         assert self.tw.config['nag'] == "You have more urgent tasks."
-        assert self.tw.config['debug'] == "no"
+        assert self.tw.config['default.command'] == "next"
+        assert self.tw.config['dependency.indicator'] == "D"