test: Update tests to mock async_dispatch for asynchronous tool execution engine.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import unittest.mock
|
||||
from unittest.mock import patch, MagicMock
|
||||
from src import ai_client
|
||||
|
||||
@@ -55,7 +56,7 @@ def test_deepseek_tool_calling(mock_post: MagicMock) -> None:
|
||||
"""
|
||||
ai_client.set_provider("deepseek", "deepseek-chat")
|
||||
with patch("src.ai_client._load_credentials", return_value={"deepseek": {"api_key": "test-key"}}), \
|
||||
patch("src.mcp_client.dispatch") as mock_dispatch:
|
||||
patch("src.mcp_client.async_dispatch", new_callable=unittest.mock.AsyncMock) as mock_dispatch:
|
||||
|
||||
# Round 1: Model calls a tool
|
||||
mock_resp1 = MagicMock()
|
||||
|
||||
Reference in New Issue
Block a user