mirror of
https://github.com/tiennm99/serena.git
synced 2026-08-07 08:25:13 +00:00
Update references to make_tool function in tests
This commit is contained in:
+4
-4
@@ -79,7 +79,7 @@ class SerenaMCPFactory:
|
||||
self.project = project
|
||||
|
||||
@staticmethod
|
||||
def _make_mcp_tool(tool: ToolInterface) -> MCPTool:
|
||||
def make_mcp_tool(tool: ToolInterface) -> MCPTool:
|
||||
func_name = tool.get_name()
|
||||
func_doc = tool.get_apply_docstring() or ""
|
||||
func_arg_metadata = tool.get_apply_fn_metadata()
|
||||
@@ -132,7 +132,7 @@ class SerenaMCPFactory:
|
||||
if mcp is not None:
|
||||
mcp._tool_manager._tools = {}
|
||||
for tool in self._iter_tools():
|
||||
mcp_tool = self._make_mcp_tool(tool)
|
||||
mcp_tool = self.make_mcp_tool(tool)
|
||||
mcp._tool_manager._tools[tool.get_name()] = mcp_tool
|
||||
|
||||
@abstractmethod
|
||||
@@ -262,7 +262,7 @@ class SerenaMCPFactoryWithProcessIsolation(SerenaMCPFactory):
|
||||
return tool_names_included_in_this_session
|
||||
|
||||
@staticmethod
|
||||
def _make_mcp_tool(tool: ToolInterface) -> MCPTool:
|
||||
def make_mcp_tool(tool: ToolInterface) -> MCPTool:
|
||||
func_name = tool.get_name()
|
||||
func_doc = tool.get_apply_docstring() or ""
|
||||
func_arg_metadata = tool.get_apply_fn_metadata()
|
||||
@@ -315,7 +315,7 @@ class SerenaMCPFactoryWithProcessIsolation(SerenaMCPFactory):
|
||||
if mcp is not None:
|
||||
mcp._tool_manager._tools = {}
|
||||
for tool in self._iter_tools():
|
||||
mcp_tool = self._make_mcp_tool(tool)
|
||||
mcp_tool = self.make_mcp_tool(tool)
|
||||
mcp._tool_manager._tools[tool.get_name()] = mcp_tool
|
||||
|
||||
def _instantiate_agent(self, serena_config: SerenaConfig, modes: list[SerenaAgentMode]) -> None:
|
||||
|
||||
@@ -4,10 +4,12 @@ import pytest
|
||||
from mcp.server.fastmcp.tools.base import Tool as MCPTool
|
||||
|
||||
from serena.agent import SerenaAgent, ToolRegistry
|
||||
from serena.mcp import make_tool
|
||||
from serena.mcp import SerenaMCPFactory
|
||||
from serena.process_isolated_agent import ProcessIsolatedSerenaAgent, ProcessIsolatedTool
|
||||
from test.serena.test_serena_agent import SerenaConfigForTests
|
||||
|
||||
make_tool = SerenaMCPFactory.make_mcp_tool
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def in_memory_config():
|
||||
|
||||
@@ -4,7 +4,9 @@ import pytest
|
||||
from mcp.server.fastmcp.tools.base import Tool as MCPTool
|
||||
|
||||
from serena.agent import Tool, ToolRegistry
|
||||
from serena.mcp import make_tool
|
||||
from serena.mcp import SerenaMCPFactory
|
||||
|
||||
make_tool = SerenaMCPFactory.make_mcp_tool
|
||||
|
||||
|
||||
class BaseMockTool(Tool):
|
||||
|
||||
Reference in New Issue
Block a user