To fix the first error, add the following code to the
_tasks class in
def __eq__(self, other): return self.name == other.name and self.begins == other.begins and self.ends == other.ends def __ne__(self, other): return not self.__eq__(other)
(Beware of the wrapped line in
As you can probably tell, that code overrides the equality comparison between two
_tasks, declaring them to be equal if they have the same name, begin time and end time. That's the equality metric that's implicitly assumed by the test code.
The second error can be fixed by fixing the typographical errors in
def add(self, task): for contained in self.tasks: if task.overlaps(contained): if task.excludes(contained) or contained.excludes(task): ...