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

Method test_raw_response_content

tests/api_resources/test_files.py:195–205  ·  view source on GitHub ↗
(self, client: OpenAI, respx_mock: MockRouter)

Source from the content-addressed store, hash-verified

193 @parametrize
194 @pytest.mark.respx(base_url=base_url)
195 def test_raw_response_content(self, client: OpenAI, respx_mock: MockRouter) -> None:
196 respx_mock.get("/files/string/content").mock(return_value=httpx.Response(200, json={"foo": "bar"}))
197
198 response = client.files.with_raw_response.content(
199 "string",
200 )
201
202 assert response.is_closed is True
203 assert response.http_request.headers.get("X-Stainless-Lang") == "python"
204 file = response.parse()
205 assert_matches_type(_legacy_response.HttpxBinaryResponseContent, file, path=["response"])
206
207 @parametrize
208 @pytest.mark.respx(base_url=base_url)

Callers

nothing calls this directly

Calls 4

assert_matches_typeFunction · 0.90
getMethod · 0.45
contentMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected