MCPcopy Create free account
hub / github.com/MiniMax-AI/Mini-Agent / test_bash_tool

Function test_bash_tool

tests/test_tools.py:76–91  ·  view source on GitHub ↗

Test bash command tool.

()

Source from the content-addressed store, hash-verified

74
75@pytest.mark.asyncio
76async def test_bash_tool():
77 """Test bash command tool."""
78 print("\n=== Testing BashTool ===")
79
80 tool = BashTool()
81
82 # Test successful command
83 result = await tool.execute(command="echo 'Hello from bash'")
84 assert result.success, f"Bash failed: {result.error}"
85 assert "Hello from bash" in result.content, f"Output mismatch: {result.content}"
86 print("✅ BashTool test passed")
87
88 # Test failed command
89 result = await tool.execute(command="exit 1")
90 assert not result.success, "Command should have failed"
91 print("✅ BashTool error handling test passed")
92
93
94async def main():

Callers 1

mainFunction · 0.85

Calls 2

executeMethod · 0.95
BashToolClass · 0.90

Tested by

no test coverage detected