Adds Aditional Validations in Enum

This commit is contained in:
2025-06-22 17:37:50 -03:00
parent 6c94047ec0
commit 450d44c064
2 changed files with 28 additions and 1 deletions

View File

@@ -78,3 +78,13 @@ class TestEnumTypeParser(TestCase):
with self.assertRaises(ValueError):
parser.from_properties_impl("TestEnum", schema)
def test_enum_type_parser_throws_invalid_enum_value(self):
parser = EnumTypeParser()
schema = {
"enum": ["value1", 42, dict()],
}
with self.assertRaises(ValueError):
parser.from_properties_impl("TestEnum", schema)