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

Function test_directly_nested_model

tests/test_models.py:25–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23
24
25def test_directly_nested_model() -> None:
26 class NestedModel(BaseModel):
27 nested: BasicModel
28
29 m = NestedModel.construct(nested={"foo": "Foo!"})
30 assert m.nested.foo == "Foo!"
31
32 # mismatched types
33 m = NestedModel.construct(nested="hello!")
34 assert cast(Any, m.nested) == "hello!"
35
36
37def test_optional_nested_model() -> None:

Callers

nothing calls this directly

Calls 1

constructMethod · 0.45

Tested by

no test coverage detected