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

Function test_response_parse_bool

tests/test_legacy_response.py:46–57  ·  view source on GitHub ↗
(client: Anthropic, content: str, expected: bool)

Source from the content-addressed store, hash-verified

44 ],
45)
46def test_response_parse_bool(client: Anthropic, content: str, expected: bool) -> None:
47 response = LegacyAPIResponse(
48 raw=httpx.Response(200, content=content),
49 client=client,
50 stream=False,
51 stream_cls=None,
52 cast_to=str,
53 options=FinalRequestOptions.construct(method="get", url="/foo"),
54 )
55
56 result = response.parse(to=bool)
57 assert result is expected
58
59
60def test_response_parse_custom_stream(client: Anthropic) -> None:

Callers

nothing calls this directly

Calls 3

parseMethod · 0.95
LegacyAPIResponseClass · 0.90
constructMethod · 0.45

Tested by

no test coverage detected