There you go another version of the pyDoubles framework, mock objects for Python and more 😉
What’s new in this release?
Two minor bugfixes. You can see test cases and fixes here and here.
If you want to assert that a given object was passed in as a parameter, as exposed in this test, you have to declare the special methods “__eq__” (equals) and “__ne__” (not equals) in your objects. They are invoked when the framework asserts that the objects are the same. Otherwise, pyDoubles will see they are different instances of the object and will fail on the assertion.
On the other hand there are two new statements:
- For a spy object: was_never_called()
- Another way of stubbing out a method: then_return_input()