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

Function test_aliases

tests/test_models.py:186–195  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

184
185
186def test_aliases() -> None:
187 class Model(BaseModel):
188 my_field: int = Field(alias="myField")
189
190 m = Model.construct(myField=1)
191 assert m.my_field == 1
192
193 # mismatched types
194 m = Model.construct(myField={"hello": False})
195 assert cast(Any, m.my_field) == {"hello": False}
196
197
198def test_repr() -> None:

Callers

nothing calls this directly

Calls 1

constructMethod · 0.45

Tested by

no test coverage detected