Hi everyone. Thanks for the responses
Re 1: mockito 0.4.0
Re 2: I misspoke. What I should have said is that I overrode __eq__
in my entity class and hardcoded "return True" in it
Re 3: Yes, I downloaded the source code and I think I figured out my
issue
It looks like mockito does a != test. I'm somewhat new to python and
just learned that python has __eq__ and __ne__ methods on a class.
When I implemented __ne__ like this:
def __ne__(self, other):
return not self.__eq__(other)
then mockito worked as expected.
So the short explanation is that you need to make sure your classes
implement __eq__ and __ne__ when using them as verify matchers in your
tests. It seems like good practice to override these methods in most
cases.
As an aside, I found this page and will probably write a base mixin
class to encapsulate these equality overrides. Including it here in
case anyone else runs into this issue:
http://stackoverflow.com/questions/390250/elegant-ways-to-support-equivalence-equality-in-python-classes
thank you
-- James