X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/blobdiff_plain/7d0294524dc4edf78a43d3e0c439dc317ebdc055..2613912534bba4a68e19a76752971ac75063654b:/tasklib/tests.py diff --git a/tasklib/tests.py b/tasklib/tests.py index be54504..ca2ff4a 100644 --- a/tasklib/tests.py +++ b/tasklib/tests.py @@ -1165,6 +1165,7 @@ class LazyUUIDTaskTest(TasklibTest): def test_normal_to_lazy_equality(self): assert self.stored == self.lazy + assert not self.stored != self.lazy assert type(self.lazy) is LazyUUIDTask def test_lazy_to_lazy_equality(self): @@ -1172,6 +1173,31 @@ class LazyUUIDTaskTest(TasklibTest): lazy2 = LazyUUIDTask(self.tw, self.stored['uuid']) assert lazy1 == lazy2 + assert not lazy1 != lazy2 + assert type(lazy1) is LazyUUIDTask + assert type(lazy2) is LazyUUIDTask + + def test_normal_to_lazy_inequality(self): + # Create a different UUID by changing the last letter + wrong_uuid = self.stored['uuid'] + wrong_uuid = wrong_uuid[:-1] + ('a' if wrong_uuid[-1] != 'a' else 'b') + + wrong_lazy = LazyUUIDTask(self.tw, wrong_uuid) + + assert not self.stored == wrong_lazy + assert self.stored != wrong_lazy + assert type(wrong_lazy) is LazyUUIDTask + + def test_lazy_to_lazy_inequality(self): + # Create a different UUID by changing the last letter + wrong_uuid = self.stored['uuid'] + wrong_uuid = wrong_uuid[:-1] + ('a' if wrong_uuid[-1] != 'a' else 'b') + + lazy1 = LazyUUIDTask(self.tw, self.stored['uuid']) + lazy2 = LazyUUIDTask(self.tw, wrong_uuid) + + assert not lazy1 == lazy2 + assert lazy1 != lazy2 assert type(lazy1) is LazyUUIDTask assert type(lazy2) is LazyUUIDTask