unittest.mock.Mock.assert_called_with()

assert_called_with(*args, **kwargs)

This method is a convenient way of asserting that calls are made in a particular way:

>>> mock = Mock()
>>> mock.method(1, 2, 3, test='wow')
<Mock name='mock.method()' id='...'>
>>> mock.method.assert_called_with(1, 2, 3, test='wow')
doc_python
2016-10-07 17:46:08
Comments
Leave a Comment

Please login to continue.