MCPcopy Create free account
hub / github.com/bcefghj/miniClaudeCode / TestBashTool

Class TestBashTool

tests/test_tools.py:41–60  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39
40
41class 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
63class TestFileReadTool(unittest.TestCase):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected