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

Method test_raw_response

tests/test_client.py:128–134  ·  tests/test_client.py::TestOpenAI.test_raw_response
(self, respx_mock: MockRouter, client: OpenAI)

Source from the content-addressed store, hash-verified

126class TestOpenAI:
127 @pytest.mark.respx(base_url=base_url)
128 def test_raw_response(self, respx_mock: MockRouter, client: OpenAI) -> None:
129 respx_mock.post(class="st">"/foo").mock(return_value=httpx.Response(200, json={class="st">"foo": class="st">"bar"}))
130
131 response = client.post(class="st">"/foo", cast_to=httpx.Response)
132 assert response.status_code == 200
133 assert isinstance(response, httpx.Response)
134 assert response.json() == {class="st">"foo": class="st">"bar"}
135
136 @pytest.mark.respx(base_url=base_url)
137 def test_raw_response_for_binary(self, respx_mock: MockRouter, client: OpenAI) -> None:

Callers

nothing calls this directly

Calls 2

postMethod · 0.45
jsonMethod · 0.45

Tested by

no test coverage detected