From 039597289e4f1c13774ac017aea491b5fdfd3f53 Mon Sep 17 00:00:00 2001 From: Alexander Tikhonov Date: Sun, 24 Nov 2024 19:30:46 +0300 Subject: [PATCH] Increase coverage --- tests/test_jsonschema/test_json_schema_common.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/test_jsonschema/test_json_schema_common.py b/tests/test_jsonschema/test_json_schema_common.py index 9b39e1c3..9e2a8f5f 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")