diff --git a/tests/test_jsonschema/test_json_schema_common.py b/tests/test_jsonschema/test_json_schema_common.py index 9b39e1c..9e2a8f5 100644 --- a/tests/test_jsonschema/test_json_schema_common.py +++ b/tests/test_jsonschema/test_json_schema_common.py @@ -1,4 +1,10 @@ +import pytest + from mashumaro.config import BaseConfig +from mashumaro.jsonschema.models import ( + JSONSchemaStringFormat, + _deserialize_json_schema_instance_format, +) from mashumaro.jsonschema.schema import Instance @@ -9,3 +15,12 @@ def test_instance_get_configs(): derived = instance.derive() assert derived.get_self_config() is instance.get_self_config() + + +def test_deserialize_json_schema_instance_format(): + assert ( + _deserialize_json_schema_instance_format("email") + is JSONSchemaStringFormat.EMAIL + ) + with pytest.raises(ValueError): + assert _deserialize_json_schema_instance_format("foobar")