From ac293013dc95026ffce0120d215e81a83ad7bee6 Mon Sep 17 00:00:00 2001 From: Joshua Valluru <326636767+joshua-berri@users.noreply.github.com> Date: Tue, 20 Oct 2026 19:22:57 -0700 Subject: [PATCH] test(bedrock): limit legacy schema tests to the picked source changes --- ...ore_utils_prompt_templates_common_utils.py | 65 +++---------------- 1 file changed, 8 insertions(+), 57 deletions(-) diff --git a/tests/test_litellm/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_common_utils.py b/tests/test_litellm/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_common_utils.py index c0ff77d19a6..8078eaf2166 100644 --- a/tests/test_litellm/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_common_utils.py +++ b/tests/test_litellm/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_common_utils.py @@ -5,7 +5,6 @@ import os import sys from collections.abc import Mapping from typing import Final -from unittest.mock import MagicMock, patch import pytest @@ -22,7 +21,6 @@ from litellm.litellm_core_utils.prompt_templates.common_utils import ( hoist_images_from_tool_messages, is_encrypted_reasoning_block, responses_reasoning_items_from_thinking_blocks, - salvage_concatenated_tool_arguments, schema_grammar_branch_count, schema_has_open_object, schema_has_unresolvable_ref, @@ -1882,66 +1880,23 @@ def _object_with(properties: Mapping[str, object], **defs: Mapping[str, object]) ("schema", "unresolvable"), [ (_object_with({"a": {"type": "string"}}), False), - ( - _object_with( - {"a": {"$ref": "#/$defs/A"}, "b": {"$ref": "#/$defs/A"}}, **{"$defs": {"A": {"type": "string"}}} - ), - False, - ), - ( - _object_with( - {"a": {"$ref": "#/definitions/A"}}, - definitions={"A": {"$ref": "#/definitions/B"}, "B": {"type": "integer"}}, - ), - False, - ), - ( - _object_with( - {"a": {"$ref": "/$defs/A"}}, - **{"$defs": {"A": {"items": {"$ref": "/$defs/B"}}, "B": {"type": "string"}}}, - ), - False, - ), + (_object_with({"a": {"$ref": "#/$defs/A"}, "b": {"$ref": "#/$defs/A"}}, **{"$defs": {"A": {"type": "string"}}}), False), + (_object_with({"a": {"$ref": "#/definitions/A"}}, definitions={"A": {"$ref": "#/definitions/B"}, "B": {"type": "integer"}}), False), + (_object_with({"a": {"$ref": "/$defs/A"}}, **{"$defs": {"A": {"items": {"$ref": "/$defs/B"}}, "B": {"type": "string"}}}), False), (_object_with({"a": {"$ref": "#/$defs/Missing"}}, **{"$defs": {"A": {"type": "string"}}}), True), (_object_with({"a": {"$ref": "other.json#/A"}}), True), (_object_with({"parent": {"$ref": "#"}}), True), - ( - _object_with( - {"a": {"$ref": "#/$defs/A"}}, **{"$defs": {"A": {"type": "array", "items": {"$ref": "#/$defs/A"}}}} - ), - True, - ), - ( - _object_with( - {"a": {"$ref": "/$defs/A"}}, **{"$defs": {"A": {"type": "array", "items": {"$ref": "/$defs/A"}}}} - ), - True, - ), + (_object_with({"a": {"$ref": "#/$defs/A"}}, **{"$defs": {"A": {"type": "array", "items": {"$ref": "#/$defs/A"}}}}), True), + (_object_with({"a": {"$ref": "/$defs/A"}}, **{"$defs": {"A": {"type": "array", "items": {"$ref": "/$defs/A"}}}}), True), ( _object_with( {"a": {"$ref": "#/$defs/A"}}, - **{ - "$defs": { - "A": {"properties": {"b": {"$ref": "#/$defs/B"}}}, - "B": {"properties": {"a": {"$ref": "#/$defs/A"}}}, - } - }, + **{"$defs": {"A": {"properties": {"b": {"$ref": "#/$defs/B"}}}, "B": {"properties": {"a": {"$ref": "#/$defs/A"}}}}}, ), True, ), ], - ids=[ - "no-refs", - "shared-def", - "chained-definitions", - "root-path-defs", - "missing-def", - "external", - "root", - "self-cycle", - "root-path-self-cycle", - "mutual-cycle", - ], + ids=["no-refs", "shared-def", "chained-definitions", "root-path-defs", "missing-def", "external", "root", "self-cycle", "root-path-self-cycle", "mutual-cycle"], ) def test_schema_has_unresolvable_ref_flags_refs_that_cannot_be_inlined(schema, unresolvable): assert schema_has_unresolvable_ref(schema) is unresolvable @@ -1950,11 +1905,7 @@ def test_schema_has_unresolvable_ref_flags_refs_that_cannot_be_inlined(schema, u @pytest.mark.parametrize( ("schema", "properties", "branches"), [ - ( - _object_with({"a": {"type": "string"}, "b": {"type": "string"}, "c": {"type": "string"}}, required=["a"]), - 3, - 8, - ), + (_object_with({"a": {"type": "string"}, "b": {"type": "string"}, "c": {"type": "string"}}, required=["a"]), 3, 8), ( _object_with( {"x": {"$ref": "#/$defs/Pair"}, "y": {"$ref": "#/$defs/Pair"}},