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

Function test_raw_dictionary

tests/test_models.py:123–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

121
122
123def test_raw_dictionary() -> None:
124 class NestedModel(BaseModel):
125 nested: Dict[str, str]
126
127 m = NestedModel.construct(nested={"hello": "world"})
128 assert m.nested == {"hello": "world"}
129
130 # mismatched types
131 m = NestedModel.construct(nested=False)
132 assert cast(Any, m.nested) is False
133
134
135def test_nested_dictionary_model() -> None:

Callers

nothing calls this directly

Calls 1

constructMethod · 0.45

Tested by

no test coverage detected