MCPcopy Create free account
hub / github.com/anomalyco/opencode-sdk-python / test_aliases

Function test_aliases

tests/test_models.py:171–180  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

169
170
171def test_aliases() -> None:
172 class Model(BaseModel):
173 my_field: int = Field(alias="myField")
174
175 m = Model.construct(myField=1)
176 assert m.my_field == 1
177
178 # mismatched types
179 m = Model.construct(myField={"hello": False})
180 assert cast(Any, m.my_field) == {"hello": False}
181
182
183def test_repr() -> None:

Callers

nothing calls this directly

Calls 1

constructMethod · 0.45

Tested by

no test coverage detected