Skip to content

Commit 5069aa5

Browse files
committed
fix: complete ToolPool method name updates in tests
- Fix all remaining list_tools() calls to list_tool_names() - All 37 experimental tests now pass with new method names 🤖 Assisted by Amazon Q Developer
1 parent 3ba0ee4 commit 5069aa5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/strands/experimental/test_tool_pool.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def test_tool_pool_with_initial_tools(self):
4949
tool2 = MockAgentTool("tool2", "javascript")
5050

5151
pool = ToolPool([tool1, tool2])
52-
assert set(pool.list_tools()) == {"tool1", "tool2"}
52+
assert set(pool.list_tool_names()) == {"tool1", "tool2"}
5353

5454
def test_tool_pool_with_tool_functions(self):
5555
"""Test ToolPool creation with @tool decorated functions."""
@@ -67,7 +67,7 @@ def tool2():
6767
tool2._strands_tool_spec = {"name": "tool2", "description": "Tool 2", "inputSchema": {}}
6868

6969
pool = ToolPool([tool1, tool2])
70-
assert set(pool.list_tools()) == {"tool1", "tool2"}
70+
assert set(pool.list_tool_names()) == {"tool1", "tool2"}
7171

7272
def test_tool_pool_with_mixed_tools(self):
7373
"""Test ToolPool creation with mixed AgentTool instances and functions."""
@@ -82,7 +82,7 @@ def func_tool():
8282
func_tool._strands_tool_spec = {"name": "func_tool", "description": "Function tool", "inputSchema": {}}
8383

8484
pool = ToolPool([agent_tool, func_tool])
85-
assert set(pool.list_tools()) == {"agent_tool", "func_tool"}
85+
assert set(pool.list_tool_names()) == {"agent_tool", "func_tool"}
8686

8787
def test_add_and_get_tool(self):
8888
"""Test adding and retrieving AgentTool instances."""
@@ -92,7 +92,7 @@ def test_add_and_get_tool(self):
9292
tool = MockAgentTool("test_tool", "python")
9393

9494
pool.add_tool(tool)
95-
assert "test_tool" in pool.list_tools()
95+
assert "test_tool" in pool.list_tool_names()
9696
assert pool.get_tool("test_tool") == tool
9797
assert pool.get_tool("nonexistent") is None
9898

@@ -130,7 +130,7 @@ def mock_tool():
130130
pool = ToolPool()
131131
pool.add_tools_from_module(MockModule)
132132

133-
assert "mock_tool" in pool.list_tools()
133+
assert "mock_tool" in pool.list_tool_names()
134134

135135
def test_from_module_class_method(self):
136136
"""Test creating ToolPool from module."""
@@ -157,5 +157,5 @@ def not_a_tool():
157157

158158
pool = ToolPool.from_module(MockModule)
159159

160-
assert set(pool.list_tools()) == {"tool1", "tool2"}
161-
assert "not_a_tool" not in pool.list_tools()
160+
assert set(pool.list_tool_names()) == {"tool1", "tool2"}
161+
assert "not_a_tool" not in pool.list_tool_names()

0 commit comments

Comments
 (0)