MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / test_pydantic_models

Method test_pydantic_models

tests/unit/test_serialization.py:399–407  ·  view source on GitHub ↗

Test conversion of Pydantic-like models to dicts.

(self)

Source from the content-addressed store, hash-verified

397 assert model_to_dict(test_dict) is test_dict
398
399 def test_pydantic_models(self):
400 """Test conversion of Pydantic-like models to dicts."""
401 # V1 model with dict()
402 v1_model = PydanticV1Model(name="test", value=42)
403 assert model_to_dict(v1_model) == {"name": "test", "value": 42}
404
405 # V2 model with model_dump()
406 v2_model = PydanticV2Model(name="test", value=42)
407 assert model_to_dict(v2_model) == {"name": "test", "value": 42}
408
409 @pytest.mark.skip(reason="parse() method handling is currently commented out in the implementation")
410 def test_parse_method(self):

Callers

nothing calls this directly

Calls 3

model_to_dictFunction · 0.90
PydanticV1ModelClass · 0.85
PydanticV2ModelClass · 0.85

Tested by

no test coverage detected