fix: Correct MCPToolWrapper patch path in fragment filtering test

The test was patching 'crewai.agent.core.MCPToolWrapper' but the import
happens inside _get_external_mcp_tools as 'from crewai.tools.mcp_tool_wrapper
import MCPToolWrapper'. Updated to patch the correct import path to ensure
the test works when it actually runs.

Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
Devin AI
2025-11-10 15:17:30 +00:00
parent cfaa44012f
commit 6063677c01

View File

@@ -148,7 +148,7 @@ class TestHTTPMCPFragmentFiltering:
}
with patch.object(agent, '_get_mcp_tool_schemas', return_value=mock_schemas):
with patch('crewai.agent.core.MCPToolWrapper') as mock_wrapper_class:
with patch('crewai.tools.mcp_tool_wrapper.MCPToolWrapper') as mock_wrapper_class:
mock_wrapper_class.return_value = MagicMock()
result = agent._get_external_mcp_tools("http://localhost:7365/mcp#specific_tool")