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

Method test_raw_response_for_binary

tests/test_client.py:137–145  ·  tests/test_client.py::TestOpenAI.test_raw_response_for_binary
(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(class="st">"/foo").mock(
139 return_value=httpx.Response(200, headers={class="st">"Content-Type": class="st">"application/binary"}, content=&class="cm">#x27;{class="st">"foo": class="st">"bar"}')
140 )
141
142 response = client.post(class="st">"/foo", cast_to=httpx.Response)
143 assert response.status_code == 200
144 assert isinstance(response, httpx.Response)
145 assert response.json() == {class="st">"foo": class="st">"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