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

test_deprecated_alias() — anthropic-sdk-python Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

tests/test_models.py lines 471–487

def test_deprecated_alias() -> None:
    class Model(BaseModel):
        resource_id: str = Field(alias="model_id")

        @property
        def model_id(self) -> str:
            return self.resource_id

    m = Model.construct(model_id="id")
    assert m.model_id == "id"
    assert m.resource_id == "id"
    assert m.resource_id is m.model_id

    m = parse_obj(Model, {"model_id": "id"})
    assert m.model_id == "id"
    assert m.resource_id == "id"
    assert m.resource_id is m.model_id

Subdomains

Calls

Frequently Asked Questions

What does test_deprecated_alias() do?
test_deprecated_alias() is a function in the anthropic-sdk-python codebase, defined in tests/test_models.py.
Where is test_deprecated_alias() defined?
test_deprecated_alias() is defined in tests/test_models.py at line 471.
What does test_deprecated_alias() call?
test_deprecated_alias() calls 1 function(s): model_id.

Analyze Your Own Codebase

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

Try Supermodel Free