Home / Function/ test_async_response_parse_expect_model_union_non_json_content() — anthropic-sdk-python Function Reference

test_async_response_parse_expect_model_union_non_json_content() — anthropic-sdk-python Function Reference

Architecture documentation for the test_async_response_parse_expect_model_union_non_json_content() function in test_response.py from the anthropic-sdk-python codebase.

Entity Profile

Dependency Diagram

graph TD
  63bef7d9_d592_2f06_ca71_b8469716ad8c["test_async_response_parse_expect_model_union_non_json_content()"]
  d84478fe_6b5f_cefd_a948_48255cf7924b["test_response.py"]
  63bef7d9_d592_2f06_ca71_b8469716ad8c -->|defined in| d84478fe_6b5f_cefd_a948_48255cf7924b
  style 63bef7d9_d592_2f06_ca71_b8469716ad8c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_response.py lines 306–318

async def test_async_response_parse_expect_model_union_non_json_content(async_client: AsyncAnthropic) -> None:
    response = AsyncAPIResponse(
        raw=httpx.Response(200, content=b"foo", headers={"Content-Type": "application/text"}),
        client=async_client,
        stream=False,
        stream_cls=None,
        cast_to=str,
        options=FinalRequestOptions.construct(method="get", url="/foo"),
    )

    obj = await response.parse(to=cast(Any, Union[CustomModel, OtherModel]))
    assert isinstance(obj, str)
    assert obj == "foo"

Subdomains

Frequently Asked Questions

What does test_async_response_parse_expect_model_union_non_json_content() do?
test_async_response_parse_expect_model_union_non_json_content() is a function in the anthropic-sdk-python codebase, defined in tests/test_response.py.
Where is test_async_response_parse_expect_model_union_non_json_content() defined?
test_async_response_parse_expect_model_union_non_json_content() is defined in tests/test_response.py at line 306.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free