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

test_aliases() — anthropic-sdk-python Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  f11a70b4_2a8f_56c8_8203_7d57b27661ec["test_aliases()"]
  7872e60b_4210_5600_119f_c5d08c52091e["test_models.py"]
  f11a70b4_2a8f_56c8_8203_7d57b27661ec -->|defined in| 7872e60b_4210_5600_119f_c5d08c52091e
  style f11a70b4_2a8f_56c8_8203_7d57b27661ec fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

tests/test_models.py lines 171–180

def test_aliases() -> None:
    class Model(BaseModel):
        my_field: int = Field(alias="myField")

    m = Model.construct(myField=1)
    assert m.my_field == 1

    # mismatched types
    m = Model.construct(myField={"hello": False})
    assert cast(Any, m.my_field) == {"hello": False}

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free