Add possibility to mock special methods
Currently only __getattr__
and __setattr__
can be mocked.
There is need to allow mocking of arbitrary special methods, like context managers, key getting/setting etc.
For example:
obj = Mock('obj')
obj.__getitem__.expect_call('foo')
Edited by Maciej Wiatrzyk