view Mock @ 244:eee52d5a4af8 default tip

created
author 127.0.0.1
date Sun, 30 Jun 2013 11:08:33 +0200
parents 9b2fd137165b
children
line wrap: on
line source

{{{#!python
from unittest.mock import MagicMock

thing = ProductionClass()
thing.method = MagicMock(return_value=3)
ret = thing.method(3, 4, 5, key='value')
assert ret == 3
thing.method.assert_called_with(3, 4, 5, key='value')
}}}