MCPcopy Create free account
hub / github.com/anomalyco/opencode-sdk-python / test_async_response_parse_bool

Function test_async_response_parse_bool

tests/test_response.py:229–240  ·  view source on GitHub ↗
(client: AsyncOpencode, content: str, expected: bool)

Source from the content-addressed store, hash-verified

227 ],
228)
229async def test_async_response_parse_bool(client: AsyncOpencode, content: str, expected: bool) -> None:
230 response = AsyncAPIResponse(
231 raw=httpx.Response(200, content=content),
232 client=client,
233 stream=False,
234 stream_cls=None,
235 cast_to=str,
236 options=FinalRequestOptions.construct(method="get", url="/foo"),
237 )
238
239 result = await response.parse(to=bool)
240 assert result is expected
241
242
243class OtherModel(BaseModel):

Callers

nothing calls this directly

Calls 3

parseMethod · 0.95
AsyncAPIResponseClass · 0.90
constructMethod · 0.45

Tested by

no test coverage detected