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

Function test_async_response_parse_bool

tests/test_response.py:276–287  ·  tests/test_response.py::test_async_response_parse_bool
(client: AsyncOpenAI, content: str, expected: bool)

Source from the content-addressed store, hash-verified

274 ],
275)
276async def test_async_response_parse_bool(client: AsyncOpenAI, content: str, expected: bool) -> None:
277 response = AsyncAPIResponse(
278 raw=httpx.Response(200, content=content),
279 client=client,
280 stream=False,
281 stream_cls=None,
282 cast_to=str,
283 options=FinalRequestOptions.construct(method=class="st">"get", url=class="st">"/foo"),
284 )
285
286 result = await response.parse(to=bool)
287 assert result is expected
288
289
290class OtherModel(BaseModel):

Callers

nothing calls this directly

Calls 3

parseMethod · 0.95
AsyncAPIResponseClass · 0.90
constructMethod · 0.45

Tested by

no test coverage detected