(client: Anthropic)
| 126 | |
| 127 | |
| 128 | def test_response_parse_custom_model(client: Anthropic) -> None: |
| 129 | response = APIResponse( |
| 130 | raw=httpx.Response(200, content=json.dumps({"foo": "hello!", "bar": 2})), |
| 131 | client=client, |
| 132 | stream=False, |
| 133 | stream_cls=None, |
| 134 | cast_to=str, |
| 135 | options=FinalRequestOptions.construct(method="get", url="/foo"), |
| 136 | ) |
| 137 | |
| 138 | obj = response.parse(to=CustomModel) |
| 139 | assert obj.foo == "hello!" |
| 140 | assert obj.bar == 2 |
| 141 | |
| 142 | |
| 143 | @pytest.mark.asyncio |
nothing calls this directly
no test coverage detected