MCPcopy Create free account
hub / github.com/ScrapeGraphAI/toonify / test_simple_model

Method test_simple_model

tests/test_pydantic.py:17–29  ·  view source on GitHub ↗

Test encoding a simple Pydantic model.

(self)

Source from the content-addressed store, hash-verified

15 """Tests for encode_pydantic function."""
16
17 def test_simple_model(self):
18 """Test encoding a simple Pydantic model."""
19 class User(BaseModel):
20 id: int
21 name: str
22 email: str
23
24 user = User(id=1, name='Alice', email='alice@example.com')
25 toon = encode_pydantic(user)
26
27 assert 'id: 1' in toon
28 assert 'name: Alice' in toon
29 assert 'email: alice@example.com' in toon
30
31 def test_list_of_models_tabular(self):
32 """Test encoding a list of uniform Pydantic models (tabular format)."""

Callers

nothing calls this directly

Calls 2

encode_pydanticFunction · 0.90
UserClass · 0.70

Tested by

no test coverage detected