Mock one deployment: its token endpoint mints `token` and its messages endpoint accepts anything. Pair with `_requests_to` to check that a client only ever talks to (and presents tokens from) the deployment it was built for.
(respx_mock: MockRouter, base_url: str, token: str)
| 2419 | |
| 2420 | |
| 2421 | def _mock_deployment(respx_mock: MockRouter, base_url: str, token: str) -> None: |
| 2422 | """Mock one deployment: its token endpoint mints `token` and its |
| 2423 | messages endpoint accepts anything. Pair with `_requests_to` to |
| 2424 | check that a client only ever talks to (and presents tokens from) the |
| 2425 | deployment it was built for.""" |
| 2426 | _mock_token_exchange(respx_mock, base_url, token) |
| 2427 | respx_mock.post(f"{base_url}/v1/messages").mock(return_value=_message_response()) |
| 2428 | |
| 2429 | |
| 2430 | def _requests_to(respx_mock: MockRouter, base_url: str) -> List[httpx2.Request]: |
no test coverage detected