MCPcopy
hub / github.com/long2ice/fastapi-cache / test_json_coder

Function test_json_coder

tests/test_codecs.py:56–60  ·  view source on GitHub ↗
(value: Any, return_type: Type[Any])

Source from the content-addressed store, hash-verified

54 ],
55)
56def test_json_coder(value: Any, return_type: Type[Any]) -> None:
57 encoded_value = JsonCoder.encode(value)
58 assert isinstance(encoded_value, bytes)
59 decoded_value = JsonCoder.decode_as_type(encoded_value, type_=return_type)
60 assert decoded_value == value
61
62
63def test_json_coder_validation_error() -> None:

Callers

nothing calls this directly

Calls 2

encodeMethod · 0.45
decode_as_typeMethod · 0.45

Tested by

no test coverage detected