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

Function test_strict_validation_unknown_fields

tests/test_models.py:160–168  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

158
159
160def test_strict_validation_unknown_fields() -> None:
161 class Model(BaseModel):
162 foo: str
163
164 model = parse_obj(Model, dict(foo="hello!", user="Robert"))
165 assert model.foo == "hello!"
166 assert cast(Any, model).user == "Robert"
167
168 assert model_dump(model) == {"foo": "hello!", "user": "Robert"}
169
170
171def test_aliases() -> None:

Callers

nothing calls this directly

Calls 2

parse_objFunction · 0.90
model_dumpFunction · 0.90

Tested by

no test coverage detected