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

Function test_response_parse_custom_stream

tests/test_response.py:96–107  ·  view source on GitHub ↗
(client: OpenAI)

Source from the content-addressed store, hash-verified

94
95
96def test_response_parse_custom_stream(client: OpenAI) -> None:
97 response = APIResponse(
98 raw=httpx.Response(200, content=b"foo"),
99 client=client,
100 stream=True,
101 stream_cls=None,
102 cast_to=str,
103 options=FinalRequestOptions.construct(method="get", url="/foo"),
104 )
105
106 stream = response.parse(to=Stream[int])
107 assert stream._cast_to == int
108
109
110@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