| 1398 | |
| 1399 | @pytest.mark.respx(base_url=base_url) |
| 1400 | async def test_raw_response_for_binary(self, respx_mock: MockRouter, async_client: AsyncOpenAI) -> None: |
| 1401 | respx_mock.post("/foo").mock( |
| 1402 | return_value=httpx.Response(200, headers={"Content-Type": "application/binary"}, content='{"foo": "bar"}') |
| 1403 | ) |
| 1404 | |
| 1405 | response = await async_client.post("/foo", cast_to=httpx.Response) |
| 1406 | assert response.status_code == 200 |
| 1407 | assert isinstance(response, httpx.Response) |
| 1408 | assert response.json() == {"foo": "bar"} |
| 1409 | |
| 1410 | def test_copy(self, async_client: AsyncOpenAI) -> None: |
| 1411 | copied = async_client.copy() |