hermes-agent/tests/hermes_cli/test_setup_agent_settings.py
alt-glitch 4b16341975 refactor(restructure): rewrite all imports for hermes_agent package
Rewrite all import statements, patch() targets, sys.modules keys,
importlib.import_module() strings, and subprocess -m references to use
hermes_agent.* paths.

Strip sys.path.insert hacks from production code (rely on editable install).
Update COMPONENT_PREFIXES for logger filtering.
Fix 3 hardcoded getLogger() calls to use __name__.
Update transport and tool registry discovery paths.
Update plugin module path strings.
Add legacy process-name patterns for gateway PID detection.
Add main() to skills_sync for console_script entry point.
Fix _get_bundled_dir() path traversal after move.

Part of #14182, #14183
2026-04-23 08:35:34 +05:30

29 lines
1.3 KiB
Python

"""Tests for agent-settings copy in the interactive setup wizard."""
from hermes_agent.cli.setup_wizard import setup_agent_settings
def test_setup_agent_settings_uses_displayed_max_iterations_value(tmp_path, monkeypatch, capsys):
"""The helper text should match the value shown in the prompt."""
monkeypatch.setenv("HERMES_HOME", str(tmp_path))
config = {
"agent": {"max_turns": 90},
"display": {"tool_progress": "all"},
"compression": {"threshold": 0.50},
"session_reset": {"mode": "both", "idle_minutes": 1440, "at_hour": 4},
}
prompt_answers = iter(["60", "all", "0.5"])
monkeypatch.setattr("hermes_agent.cli.setup_wizard.get_env_value", lambda key: "60" if key == "HERMES_MAX_ITERATIONS" else "")
monkeypatch.setattr("hermes_agent.cli.setup_wizard.prompt", lambda *args, **kwargs: next(prompt_answers))
monkeypatch.setattr("hermes_agent.cli.setup_wizard.prompt_choice", lambda *args, **kwargs: 4)
monkeypatch.setattr("hermes_agent.cli.setup_wizard.save_env_value", lambda *args, **kwargs: None)
monkeypatch.setattr("hermes_agent.cli.setup_wizard.save_config", lambda *args, **kwargs: None)
setup_agent_settings(config)
out = capsys.readouterr().out
assert "Press Enter to keep 60." in out
assert "Default is 90" not in out