Test bash command tool.
()
| 74 | |
| 75 | @pytest.mark.asyncio |
| 76 | async 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 | |
| 94 | async def main(): |