MCPcopy Index your code
hub / github.com/anthropics/anthropic-sdk-python / test_response_parse_custom_stream

Function test_response_parse_custom_stream

tests/test_response.py:94–105  ·  view source on GitHub ↗
(client: Anthropic)

Source from the content-addressed store, hash-verified

92
93
94def test_response_parse_custom_stream(client: Anthropic) -> None:
95 response = APIResponse(
96 raw=httpx.Response(200, content=b"foo"),
97 client=client,
98 stream=True,
99 stream_cls=None,
100 cast_to=str,
101 options=FinalRequestOptions.construct(method="get", url="/foo"),
102 )
103
104 stream = response.parse(to=Stream[int])
105 assert stream._cast_to == int
106
107
108@pytest.mark.asyncio

Callers

nothing calls this directly

Calls 3

parseMethod · 0.95
APIResponseClass · 0.90
constructMethod · 0.45

Tested by

no test coverage detected