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

Function test_async_response_parse_bool

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

parseMethod · 0.95
AsyncAPIResponseClass · 0.90
constructMethod · 0.45

Tested by

no test coverage detected