MCPcopy
hub / github.com/openai/openai-python / test_raw_response_for_binary

Method test_raw_response_for_binary

tests/test_client.py:1400–1408  ·  view source on GitHub ↗
(self, respx_mock: MockRouter, async_client: AsyncOpenAI)

Source from the content-addressed store, hash-verified

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()

Callers

nothing calls this directly

Calls 2

postMethod · 0.45
jsonMethod · 0.45

Tested by

no test coverage detected