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

Function test_omitted_fields

tests/test_models.py:490–501  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

488
489
490def test_omitted_fields() -> None:
491 class Model(BaseModel):
492 resource_id: Optional[str] = None
493
494 m = Model.construct()
495 assert "resource_id" not in m.model_fields_set
496
497 m = Model.construct(resource_id=None)
498 assert "resource_id" in m.model_fields_set
499
500 m = Model.construct(resource_id="foo")
501 assert "resource_id" in m.model_fields_set
502
503
504def test_to_dict() -> None:

Callers

nothing calls this directly

Calls 1

constructMethod · 0.45

Tested by

no test coverage detected