From 836283bdb7b3a447d44e3df0e12fe13fe48dff70 Mon Sep 17 00:00:00 2001 From: longwind48 Date: Tue, 25 Aug 2026 13:45:10 +0800 Subject: [PATCH] test(cost): assert the item-count fallback through the public cost entry point Two fallback tests reached for _count_web_search_calls directly. Bill them through get_cost_for_built_in_tools instead: same guarantee, and the assertion is now the charge a caller would see rather than an internal count. --- .../test_bedrock_mantle_responses_transformation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_responses_transformation.py b/tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_responses_transformation.py index 39f027789d3..2ed12141f1d 100644 --- a/tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_responses_transformation.py +++ b/tests/test_litellm/llms/bedrock_mantle/test_bedrock_mantle_responses_transformation.py @@ -425,11 +425,11 @@ class TestBedrockMantleResponsesNativeWebSearch: assert params["tools"] == [_function_tool()] def test_web_search_is_not_advertised_unless_the_request_asks_for_it(self, local_model_cost_map): - """The tool type widens only for requests that carry it, so a capable model's - other requests keep the provider-wide set and never reach the cost map.""" + """The tool type set widens only for requests that carry a Web Search tool, so a capable + model's other requests keep the provider-wide set and never reach the cost map.""" cfg = BedrockMantleResponsesAPIConfig() supported = cfg._supported_response_tool_types(tools=[_function_tool()], model="openai.gpt-5.6-terra") - assert "web_search" not in supported + assert "web_search" not in supported, "a request carrying no web_search tool must not widen the set" assert "function" in supported def test_web_search_hoisted_out_of_codex_additional_tools(self, local_model_cost_map):