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

test_nested_dictionary_model() — anthropic-sdk-python Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

tests/test_models.py lines 135–145

def test_nested_dictionary_model() -> None:
    class NestedModel(BaseModel):
        nested: Dict[str, BasicModel]

    m = NestedModel.construct(nested={"hello": {"foo": "bar"}})
    assert isinstance(m.nested, dict)
    assert m.nested["hello"].foo == "bar"

    # mismatched types
    m = NestedModel.construct(nested={"hello": False})
    assert cast(Any, m.nested["hello"]) is False

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free