shellmcp: tool description lists installed modern tools
This commit is contained in:
@@ -44,3 +44,14 @@ class Sandbox(unittest.TestCase):
|
||||
self.assertNotIn("key", out)
|
||||
self.assertIn("tmp-ok", out)
|
||||
self.assertFalse(os.path.exists(os.path.join(d, "new")))
|
||||
|
||||
class Describe(unittest.TestCase):
|
||||
def test_names_only_installed_tools_and_the_mode(self):
|
||||
with mock.patch("shutil.which", lambda name: name in ("fd", "rg")):
|
||||
text = shellmcp.describe("readonly", "/srv", 60, 8000)
|
||||
self.assertIn("in /srv.", text)
|
||||
self.assertIn("Read-only sandbox", text)
|
||||
self.assertIn("prefer these: rg: search file contents (instead of grep); "
|
||||
"fd: find files (instead of find).", text)
|
||||
self.assertNotIn("jq", text)
|
||||
self.assertIn("full permissions", shellmcp.describe("all", "/srv", 60, 8000))
|
||||
|
||||
Reference in New Issue
Block a user