shellmcp: tool description lists installed modern tools

This commit is contained in:
2026-11-05 10:17:18 +01:00
parent b95c3d662b
commit 60219ef8f8
2 changed files with 36 additions and 0 deletions
+11
View File
@@ -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))