Assert that only the specified mock function was called.
(
mock_functions: MockFnDict, function_name: MockFunctions
)
| 33 | |
| 34 | |
| 35 | def assert_only_one_called( |
| 36 | mock_functions: MockFnDict, function_name: MockFunctions |
| 37 | ) -> None: |
| 38 | """Assert that only the specified mock function was called.""" |
| 39 | for name, mock_fn in mock_functions.items(): |
| 40 | if name == function_name: |
| 41 | mock_fn.assert_called_once() |
| 42 | else: |
| 43 | mock_fn.assert_not_called() |
| 44 | |
| 45 | |
| 46 | def assert_multiple_called_once( |
no test coverage detected
searching dependent graphs…