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

Method test_raw_response

tests/test_client.py:1331–1337  ·  view source on GitHub ↗
(self, respx_mock: MockRouter, async_client: AsyncAnthropic)

Source from the content-addressed store, hash-verified

1329class TestAsyncAnthropic:
1330 @pytest.mark.respx(base_url=base_url)
1331 async def test_raw_response(self, respx_mock: MockRouter, async_client: AsyncAnthropic) -> None:
1332 respx_mock.post("/foo").mock(return_value=httpx2.Response(200, json={"foo": "bar"}))
1333
1334 response = await async_client.post("/foo", cast_to=httpx2.Response)
1335 assert response.status_code == 200
1336 assert isinstance(response, httpx2.Response)
1337 assert response.json() == {"foo": "bar"}
1338
1339 @pytest.mark.respx(base_url=base_url)
1340 async def test_raw_response_for_binary(self, respx_mock: MockRouter, async_client: AsyncAnthropic) -> None:

Callers

nothing calls this directly

Calls 2

postMethod · 0.45
jsonMethod · 0.45

Tested by

no test coverage detected