For example:
import mock
class MyClass(object):
def foo(self, x, y, z):
return (x, y, z)
class TestMyClass(TestCase)
@mock.patch('MyClass')
def TestMyClass(self, MyClassMock):
foo_mock = MyClassMock.foo()
self.assertEquals((x, y, z), foo_mock)
So, the real question is: How to get the return of that test intead of getting this <MagicMock name='MyClass.foo()' id='191728464'>
or how to deal with this MagicMock object to get the return of that test which should be a tuple containing 3 elements and nothing more or less?
Any suggestion, any idea, any argument will be welcome. Thanks in advance!