fix MCPHub group publishing and recovery
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user