mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-06 08:16:43 +00:00
test(websearch): register configured search tool in pre-request hook test
PR #38113 made a configured search_tool_name fail fast when the router does not carry a matching search tool, which broke test_pre_request_hook_modifies_request_body: it names test-search-tool but never registers it. Stub the proxy router with that tool so the test exercises the conversion path again.
This commit is contained in:
parent
174acf90c1
commit
191313e756
1 changed files with 9 additions and 1 deletions
|
|
@ -937,6 +937,14 @@ async def test_pre_request_hook_modifies_request_body():
|
|||
|
||||
print("✅ WebSearchInterceptionLogger initialized")
|
||||
|
||||
mock_router = MagicMock()
|
||||
mock_router.search_tools = [
|
||||
{
|
||||
"search_tool_name": "test-search-tool",
|
||||
"litellm_params": {"search_provider": "tavily"},
|
||||
}
|
||||
]
|
||||
|
||||
# Track what actually gets sent to the API
|
||||
captured_request = {}
|
||||
|
||||
|
|
@ -987,7 +995,7 @@ async def test_pre_request_hook_modifies_request_body():
|
|||
with patch(
|
||||
"litellm.llms.anthropic.experimental_pass_through.messages.handler.anthropic_messages_handler",
|
||||
side_effect=mock_anthropic_messages_handler,
|
||||
):
|
||||
), patch("litellm.proxy.proxy_server.llm_router", mock_router):
|
||||
|
||||
print(
|
||||
"\n📝 Making request with native web_search_20250305 tool (stream=True)..."
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue