mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-12 08:42:18 +00:00
test(mcp): model listing post-processing in session mocks
This commit is contained in:
parent
930b1cfc58
commit
e81a958e90
2 changed files with 4 additions and 0 deletions
|
|
@ -187,6 +187,7 @@ class TestMCPClientUnitTests:
|
|||
)
|
||||
]
|
||||
mock_session_instance.send_request.return_value = ListToolsResult(tools=mock_tools)
|
||||
mock_session_instance._absorb_tool_listing = MagicMock(side_effect=lambda result, **_kwargs: result)
|
||||
|
||||
client = MCPClient("http://example.com")
|
||||
result = await client.list_tools()
|
||||
|
|
@ -231,6 +232,7 @@ class TestMCPClientUnitTests:
|
|||
ListToolsResult(tools=first_page_tools, nextCursor="page-2"),
|
||||
ListToolsResult(tools=[second_page_tool]),
|
||||
]
|
||||
mock_session_instance._absorb_tool_listing = MagicMock(side_effect=lambda result, **_kwargs: result)
|
||||
|
||||
client = MCPClient("http://example.com")
|
||||
result = await client.list_tools()
|
||||
|
|
@ -272,6 +274,7 @@ class TestMCPClientUnitTests:
|
|||
),
|
||||
RuntimeError("transient upstream failure"),
|
||||
]
|
||||
mock_session_instance._absorb_tool_listing = MagicMock(side_effect=lambda result, **_kwargs: result)
|
||||
|
||||
client = MCPClient("http://example.com")
|
||||
result = await client.list_tools()
|
||||
|
|
|
|||
|
|
@ -1637,6 +1637,7 @@ class TestListToolsRestAPI:
|
|||
]
|
||||
),
|
||||
]
|
||||
mock_session_instance._absorb_tool_listing = MagicMock(side_effect=lambda result, **_kwargs: result)
|
||||
mock_session_ctx.__aenter__ = AsyncMock(return_value=mock_session_instance)
|
||||
mock_session_ctx.__aexit__ = AsyncMock(return_value=None)
|
||||
monkeypatch.setattr(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue