mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-25 00:51:20 +00:00
Fix variable name breakage (run_agent, hermes_constants, etc.) where import rewriter changed 'import X' to 'import hermes_agent.Y' but test code still referenced 'X' as a variable name. Fix package-vs-module confusion (cli.auth, cli.models, cli.ui) where single files became directories. Fix hardcoded file paths in tests pointing to old locations. Fix tool registry to discover tools in subpackage directories. Fix stale import in hermes_agent/tools/__init__.py. Part of #14182, #14183
29 lines
1 KiB
Python
29 lines
1 KiB
Python
from hermes_agent.cli import setup_wizard as setup_mod
|
|
|
|
|
|
def test_prompt_choice_uses_curses_helper(monkeypatch):
|
|
monkeypatch.setattr(setup_mod, "_curses_prompt_choice", lambda question, choices, default=0, description=None: 1)
|
|
|
|
idx = setup_mod.prompt_choice("Pick one", ["a", "b", "c"], default=0)
|
|
|
|
assert idx == 1
|
|
|
|
|
|
def test_prompt_choice_falls_back_to_numbered_input(monkeypatch):
|
|
monkeypatch.setattr(setup_mod, "_curses_prompt_choice", lambda question, choices, default=0, description=None: -1)
|
|
monkeypatch.setattr("builtins.input", lambda _prompt="": "2")
|
|
|
|
idx = setup_mod.prompt_choice("Pick one", ["a", "b", "c"], default=0)
|
|
|
|
assert idx == 1
|
|
|
|
|
|
def test_prompt_checklist_uses_shared_curses_checklist(monkeypatch):
|
|
monkeypatch.setattr(
|
|
"hermes_agent.cli.ui.curses.curses_checklist",
|
|
lambda title, items, selected, cancel_returns=None: {0, 2},
|
|
)
|
|
|
|
selected = setup_mod.prompt_checklist("Pick tools", ["one", "two", "three"], pre_selected=[1])
|
|
|
|
assert selected == [0, 2]
|