MCPcopy
hub / github.com/pydantic/pydantic / test_decimal_json

Function test_decimal_json

pydantic-core/tests/serializers/test_decimal.py:52–55  ·  view source on GitHub ↗
(value, expected)

Source from the content-addressed store, hash-verified

50 ],
51)
52def test_decimal_json(value, expected):
53 v = SchemaSerializer(core_schema.decimal_schema())
54 assert v.to_python(value, mode='json') == expected
55 assert v.to_json(value).decode() == f'"{expected}"'
56
57
58def test_any_decimal_key():

Callers

nothing calls this directly

Calls 2

decimal_schemaMethod · 0.80
decodeMethod · 0.45

Tested by

no test coverage detected