mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-11-16 19:36:54 +00:00
Change-detectors, tautologies, source-reading tests, redundant duplicates, mock-echo tests and dead/unrunnable tests. Per-test rationale in the lane ledger (category + reason for every removal).
49 lines
No EOL
1.4 KiB
Python
49 lines
No EOL
1.4 KiB
Python
"""
|
|
Tests for --yes / -y flag in `hermes skills uninstall` CLI subcommand.
|
|
|
|
Verifies the parser registers the flag and the value reaches
|
|
``do_uninstall(skip_confirm=True)`` through the real ``skills_command``
|
|
dispatch path (mirrors ``test_skills_install_flags.py``).
|
|
"""
|
|
|
|
import sys
|
|
|
|
|
|
def _run_uninstall_cli(monkeypatch, argv):
|
|
captured = {}
|
|
|
|
def fake_do_uninstall(name, *, skip_confirm=False, **kwargs):
|
|
captured["name"] = name
|
|
captured["skip_confirm"] = skip_confirm
|
|
|
|
monkeypatch.setattr("hermes_cli.skills_hub.do_uninstall", fake_do_uninstall)
|
|
monkeypatch.setattr(sys, "argv", argv)
|
|
|
|
from hermes_cli.main import main
|
|
|
|
main()
|
|
return captured
|
|
|
|
|
|
def test_cli_skills_uninstall_yes_sets_skip_confirm(monkeypatch):
|
|
"""`--yes` should propagate to do_uninstall(skip_confirm=True)."""
|
|
captured = _run_uninstall_cli(
|
|
monkeypatch,
|
|
["hermes", "skills", "uninstall", "test-skill", "--yes"],
|
|
)
|
|
|
|
assert captured["name"] == "test-skill"
|
|
assert captured["skip_confirm"] is True
|
|
|
|
|
|
|
|
|
|
def test_cli_skills_uninstall_no_flags_keeps_prompt(monkeypatch):
|
|
"""Without --yes, skip_confirm must be False (prompt preserved)."""
|
|
captured = _run_uninstall_cli(
|
|
monkeypatch,
|
|
["hermes", "skills", "uninstall", "test-skill"],
|
|
)
|
|
|
|
assert captured["name"] == "test-skill"
|
|
assert captured["skip_confirm"] is False |