MCPcopy Index your code
hub / github.com/openai/openai-python / test_raw_response_for_binary

Method test_raw_response_for_binary

tests/test_client.py:137–145  ·  view source on GitHub ↗
(self, respx_mock: MockRouter, client: OpenAI)

Source from the content-addressed store, hash-verified

135
136 @pytest.mark.respx(base_url=base_url)
137 def test_raw_response_for_binary(self, respx_mock: MockRouter, client: OpenAI) -> None:
138 respx_mock.post("/foo").mock(
139 return_value=httpx.Response(200, headers={"Content-Type": "application/binary"}, content='{"foo": "bar"}')
140 )
141
142 response = client.post("/foo", cast_to=httpx.Response)
143 assert response.status_code == 200
144 assert isinstance(response, httpx.Response)
145 assert response.json() == {"foo": "bar"}
146
147 def test_copy(self, client: OpenAI) -> None:
148 copied = client.copy()

Callers

nothing calls this directly

Calls 2

postMethod · 0.45
jsonMethod · 0.45

Tested by

no test coverage detected