From 782e09d5e3e6656093f4090a09b39cf803865322 Mon Sep 17 00:00:00 2001 From: Vitor Hideyoshi Date: Tue, 3 Jun 2025 02:35:25 -0300 Subject: [PATCH] Adds Test to SchemaConverter.build Schema Validation --- tests/test_schema_converter.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/test_schema_converter.py b/tests/test_schema_converter.py index 57894ba..22dbddd 100644 --- a/tests/test_schema_converter.py +++ b/tests/test_schema_converter.py @@ -11,6 +11,20 @@ def is_pydantic_model(cls): class TestSchemaConverter(TestCase): + def test_invalid_schema(self): + schema = { + "title": 1, + "description": "A person", + "type": "object", + "properties": { + "name": {"type": "string"}, + "age": {"type": "integer"}, + }, + } + + with self.assertRaises(ValueError): + SchemaConverter.build(schema) + def test_build_expects_title(self): schema = { "description": "A person",