(client: Anthropic)
| 92 | |
| 93 | |
| 94 | def test_response_parse_custom_stream(client: Anthropic) -> None: |
| 95 | response = APIResponse( |
| 96 | raw=httpx.Response(200, content=b"foo"), |
| 97 | client=client, |
| 98 | stream=True, |
| 99 | stream_cls=None, |
| 100 | cast_to=str, |
| 101 | options=FinalRequestOptions.construct(method="get", url="/foo"), |
| 102 | ) |
| 103 | |
| 104 | stream = response.parse(to=Stream[int]) |
| 105 | assert stream._cast_to == int |
| 106 | |
| 107 | |
| 108 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected