feat: adds test for ObjectTypeParser asserting for the presence of a ref_cache

This commit is contained in:
2025-11-24 20:00:42 -03:00
parent 9837a99ec9
commit 4baaeed349

View File

@@ -1,9 +1,24 @@
from jambo.exceptions import InternalAssertionException
from jambo.parser import ObjectTypeParser from jambo.parser import ObjectTypeParser
from unittest import TestCase from unittest import TestCase
class TestObjectTypeParser(TestCase): class TestObjectTypeParser(TestCase):
def test_object_type_parser_throws_without_ref_cache(self):
parser = ObjectTypeParser()
properties = {
"type": "object",
"properties": {
"name": {"type": "string"},
"age": {"type": "integer"},
},
}
with self.assertRaises(InternalAssertionException):
parser.from_properties_impl("placeholder", properties)
def test_object_type_parser(self): def test_object_type_parser(self):
parser = ObjectTypeParser() parser = ObjectTypeParser()