Assert that the mock was awaited exactly once and with the specified arguments.
(self, /, *args, **kwargs)
| 2394 | raise AssertionError(_error_message()) from cause |
| 2395 | |
| 2396 | def assert_awaited_once_with(self, /, *args, **kwargs): |
| 2397 | """ |
| 2398 | Assert that the mock was awaited exactly once and with the specified |
| 2399 | arguments. |
| 2400 | """ |
| 2401 | if not self.await_count == 1: |
| 2402 | msg = (f"Expected {self._mock_name or 'mock'} to have been awaited once." |
| 2403 | f" Awaited {self.await_count} times.") |
| 2404 | raise AssertionError(msg) |
| 2405 | return self.assert_awaited_with(*args, **kwargs) |
| 2406 | |
| 2407 | def assert_any_await(self, /, *args, **kwargs): |
| 2408 | """ |