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

Method assert_called_once

Lib/unittest/mock.py:956–964  ·  view source on GitHub ↗

assert that the mock was called only once.

(self)

Source from the content-addressed store, hash-verified

954 raise AssertionError(msg)
955
956 def assert_called_once(self):
957 """assert that the mock was called only once.
958 """
959 if not self.call_count == 1:
960 msg = ("Expected '%s' to have been called once. Called %s times.%s"
961 % (self._mock_name or 'mock',
962 self.call_count,
963 self._calls_repr()))
964 raise AssertionError(msg)
965
966 def assert_called_with(self, /, *args, **kwargs):
967 """assert that the last call was made with the specified arguments.

Calls 1

_calls_reprMethod · 0.95