fix MCPHub group publishing and recovery

This commit is contained in:
Mikei386
2026-08-26 11:42:39 +02:00
parent 167448d778
commit 9ae7d22618
5 changed files with 67 additions and 4 deletions
+13
View File
@@ -76,6 +76,19 @@ class MCPHubSettingsTests(unittest.TestCase):
with self.assertRaises(SystemExit):
self.module.registry_servers(self.registry, self.secrets, {})
def test_hermes_group_is_recoverable_and_bounded(self):
settings = {"groups": [{"id": "keep", "name": "other", "servers": []}]}
self.module.ensure_hermes_group(settings)
self.module.ensure_hermes_group(settings)
groups = settings["groups"]
self.assertEqual(len([group for group in groups if group["name"] == "hermes"]), 1)
hermes = next(group for group in groups if group["name"] == "hermes")
fritzbox = next(item for item in hermes["servers"] if item["name"] == "fritzbox")
self.assertEqual(
fritzbox["tools"],
["list_services", "list_actions", "describe_action", "call_action"],
)
if __name__ == "__main__":
unittest.main()