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

Function test_response_parse_bool

tests/test_response.py:247–258  ·  view source on GitHub ↗
(client: Anthropic, content: str, expected: bool)

Source from the content-addressed store, hash-verified

245 ],
246)
247def test_response_parse_bool(client: Anthropic, content: str, expected: bool) -> None:
248 response = APIResponse(
249 raw=httpx2.Response(200, content=content),
250 client=client,
251 stream=False,
252 stream_cls=None,
253 cast_to=str,
254 options=FinalRequestOptions.construct(method="get", url="/foo"),
255 )
256
257 result = response.parse(to=bool)
258 assert result is expected
259
260
261@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

parseMethod · 0.95
APIResponseClass · 0.90
constructMethod · 0.45

Tested by

no test coverage detected