mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-31 19:16:29 +00:00
test(tui): make _load_enabled_toolsets assertions tolerant of first-release back-filled toolsets
The two exact-list assertions in test_tui_gateway_server froze the toolset list and broke the moment _RECENTLY_SHIPPED_TOOLSETS back-filled bfl onto a saved platform list — the exact behavior the sibling change ships on purpose. Assert the invariant instead: the expected base set is present, and anything extra must be inside _RECENTLY_SHIPPED_TOOLSETS (vacuously exact again once that set empties between releases).
This commit is contained in:
parent
97c6a183af
commit
c0689c3bcb
1 changed files with 14 additions and 2 deletions
|
|
@ -1998,7 +1998,14 @@ def test_load_enabled_toolsets_rejects_disabled_mcp_env(monkeypatch, capsys):
|
|||
# Sorted: ["kanban", "memory", "project"]. `kanban` is auto-recovered by
|
||||
# _get_platform_tools (a non-configurable platform toolset in hermes-cli's
|
||||
# universe); `project` is GUI-only, folded in by _load_enabled_toolsets.
|
||||
assert server._load_enabled_toolsets() == ["kanban", "memory", "project"]
|
||||
# Toolsets inside their first release (_RECENTLY_SHIPPED_TOOLSETS) are
|
||||
# back-filled onto saved lists that never offered them — allow those too.
|
||||
from hermes_cli.tools_config import _RECENTLY_SHIPPED_TOOLSETS
|
||||
|
||||
result = server._load_enabled_toolsets()
|
||||
assert result is not None
|
||||
assert {"kanban", "memory", "project"} <= set(result)
|
||||
assert set(result) - {"kanban", "memory", "project"} <= _RECENTLY_SHIPPED_TOOLSETS
|
||||
err = capsys.readouterr().err
|
||||
assert "ignoring disabled MCP servers" in err
|
||||
assert "mcp-off" in err
|
||||
|
|
@ -2019,7 +2026,12 @@ def test_load_enabled_toolsets_falls_back_when_tui_env_invalid(monkeypatch, caps
|
|||
config_mod, "load_config", lambda: {"platform_toolsets": {"cli": ["memory"]}}
|
||||
)
|
||||
|
||||
assert server._load_enabled_toolsets() == ["kanban", "memory", "project"]
|
||||
from hermes_cli.tools_config import _RECENTLY_SHIPPED_TOOLSETS
|
||||
|
||||
result = server._load_enabled_toolsets()
|
||||
assert result is not None
|
||||
assert {"kanban", "memory", "project"} <= set(result)
|
||||
assert set(result) - {"kanban", "memory", "project"} <= _RECENTLY_SHIPPED_TOOLSETS
|
||||
assert "using configured CLI toolsets" in capsys.readouterr().err
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue