From: Sergey Trofimov Date: Fri, 20 May 2016 12:33:47 +0000 (+0300) Subject: increase coverage X-Git-Url: https://git.madduck.net/etc/taskwarrior.git/commitdiff_plain/f874381c6358b993dbc02c63f9ae6995d3fed4e4?hp=-c increase coverage --- f874381c6358b993dbc02c63f9ae6995d3fed4e4 diff --git a/tasklib/lazy.py b/tasklib/lazy.py index a1b63ef..f9e0c0a 100644 --- a/tasklib/lazy.py +++ b/tasklib/lazy.py @@ -36,6 +36,9 @@ class LazyUUIDTask(object): # For saved Tasks, just define equality by equality of uuids return self['uuid'] == other['uuid'] + def __ne__(self, other): + return not self.__eq__(other) + def __hash__(self): return self['uuid'].__hash__() diff --git a/tasklib/tests.py b/tasklib/tests.py index be54504..af873e1 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,7 @@ 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