MCPcopy Create free account
hub / github.com/anthropics/anthropic-sdk-python / test_raw_dictionary

Function test_raw_dictionary

tests/test_models.py:138–147  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

136
137
138def test_raw_dictionary() -> None:
139 class NestedModel(BaseModel):
140 nested: Dict[str, str]
141
142 m = NestedModel.construct(nested={"hello": "world"})
143 assert m.nested == {"hello": "world"}
144
145 # mismatched types
146 m = NestedModel.construct(nested=False)
147 assert cast(Any, m.nested) is False
148
149
150def test_nested_dictionary_model() -> None:

Callers

nothing calls this directly

Calls 1

constructMethod · 0.45

Tested by

no test coverage detected