MCPcopy
hub / github.com/openai/openai-python / test_strict_validation_unknown_fields

Function test_strict_validation_unknown_fields

tests/test_models.py:161–169  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

parse_objFunction · 0.90
model_dumpFunction · 0.90

Tested by

no test coverage detected