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

Function test_async_response_parse_bool

tests/test_response.py:272–283  ·  view source on GitHub ↗
(client: AsyncAnthropic, content: str, expected: bool)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

parseMethod · 0.95
AsyncAPIResponseClass · 0.90
constructMethod · 0.45

Tested by

no test coverage detected