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

Function test_repr_nested_model

tests/test_models.py:189–200  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

187
188
189def test_repr_nested_model() -> None:
190 class Child(BaseModel):
191 name: str
192 age: int
193
194 class Parent(BaseModel):
195 name: str
196 child: Child
197
198 model = Parent(name="Robert", child=Child(name="Foo", age=5))
199 assert str(model) == "Parent(name='Robert', child=Child(name='Foo', age=5))"
200 assert repr(model) == "Parent(name='Robert', child=Child(name='Foo', age=5))"
201
202
203def test_optional_list() -> None:

Callers

nothing calls this directly

Calls 2

ParentClass · 0.85
ChildClass · 0.85

Tested by

no test coverage detected