MCPcopy Index your code
hub / github.com/RustPython/RustPython / assert_called_once_with

Method assert_called_once_with

Lib/unittest/mock.py:988–997  ·  view source on GitHub ↗

assert that the mock was called exactly once and that that call was with the specified arguments.

(self, /, *args, **kwargs)

Source from the content-addressed store, hash-verified

986
987
988 def assert_called_once_with(self, /, *args, **kwargs):
989 """assert that the mock was called exactly once and that that call was
990 with the specified arguments."""
991 if not self.call_count == 1:
992 msg = ("Expected '%s' to be called once. Called %s times.%s"
993 % (self._mock_name or 'mock',
994 self.call_count,
995 self._calls_repr()))
996 raise AssertionError(msg)
997 return self.assert_called_with(*args, **kwargs)
998
999
1000 def assert_has_calls(self, calls, any_order=False):

Calls 2

_calls_reprMethod · 0.95
assert_called_withMethod · 0.95