MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / test_raw_response

Method test_raw_response

tests/test_client.py:187–193  ·  view source on GitHub ↗
(self, respx_mock: MockRouter, client: Anthropic)

Source from the content-addressed store, hash-verified

185
186 @pytest.mark.respx(base_url=base_url)
187 def test_raw_response(self, respx_mock: MockRouter, client: Anthropic) -> None:
188 respx_mock.post("/foo").mock(return_value=httpx2.Response(200, json={"foo": "bar"}))
189
190 response = client.post("/foo", cast_to=httpx2.Response)
191 assert response.status_code == 200
192 assert isinstance(response, httpx2.Response)
193 assert response.json() == {"foo": "bar"}
194
195 @pytest.mark.respx(base_url=base_url)
196 def test_raw_response_for_binary(self, respx_mock: MockRouter, client: Anthropic) -> None:

Callers

nothing calls this directly

Calls 2

postMethod · 0.45
jsonMethod · 0.45

Tested by

no test coverage detected