| 39 | |
| 40 | |
| 41 | class TestBashTool(unittest.TestCase): |
| 42 | def setUp(self): |
| 43 | self.tool = BashTool() |
| 44 | |
| 45 | def test_execute_echo(self): |
| 46 | result = self.tool.execute({"command": "echo hello"}) |
| 47 | self.assertFalse(result.is_error) |
| 48 | self.assertIn("hello", result.output) |
| 49 | |
| 50 | def test_permission_blocks_dangerous(self): |
| 51 | denial = self.tool.check_permissions({"command": "rm -rf /"}) |
| 52 | self.assertIsNotNone(denial) |
| 53 | |
| 54 | def test_permission_allows_safe(self): |
| 55 | denial = self.tool.check_permissions({"command": "echo safe"}) |
| 56 | self.assertIsNone(denial) |
| 57 | |
| 58 | def test_empty_command(self): |
| 59 | result = self.tool.execute({"command": ""}) |
| 60 | self.assertTrue(result.is_error) |
| 61 | |
| 62 | |
| 63 | class TestFileReadTool(unittest.TestCase): |
nothing calls this directly
no outgoing calls
no test coverage detected