b4fbd6fe9f
Deploy Site / deploy-vercel (push) Has been skipped
Deploy Site / deploy-docs (push) Has been skipped
Build Skills Index / build-index (push) Has been skipped
CI / Deny unrelated histories (push) Has been skipped
CI / Detect affected areas (push) Successful in 27m35s
CI / OSV scan (push) Failing after 4s
CI / Build&Test Docker image (push) Successful in 9s
CI / Supply-chain scan (push) Has been skipped
CI / Lint Docker scripts (push) Failing after 5m13s
CI / Check contributors (push) Failing after 12m8s
CI / Docs Site (push) Failing after 12m8s
CI / TypeScript (push) Failing after 12m8s
CI / Python lints (push) Failing after 12m9s
CI / Python tests (push) Failing after 12m9s
CI / Check uv.lock (push) Failing after 23m22s
CI / CI timing report (push) Has been cancelled
Build Skills Index / trigger-deploy (push) Has been cancelled
CI / All required checks pass (push) Has been cancelled
49 lines
1.6 KiB
Python
49 lines
1.6 KiB
Python
from pathlib import Path
|
|
from types import SimpleNamespace
|
|
|
|
from hermes_cli import uninstall
|
|
|
|
|
|
def test_dry_run_prints_plan_without_mutating(monkeypatch, tmp_path, capsys):
|
|
project_root = tmp_path / "hermes-agent"
|
|
hermes_home = tmp_path / ".hermes"
|
|
project_root.mkdir()
|
|
hermes_home.mkdir()
|
|
(hermes_home / "config.yaml").write_text("model: {}\n")
|
|
|
|
called = False
|
|
|
|
def _fail_if_called(**kwargs):
|
|
nonlocal called
|
|
called = True
|
|
|
|
monkeypatch.setattr(uninstall, "get_project_root", lambda: project_root)
|
|
monkeypatch.setattr(uninstall, "get_hermes_home", lambda: hermes_home)
|
|
monkeypatch.setattr(uninstall, "_is_default_hermes_home", lambda home: False)
|
|
monkeypatch.setattr(uninstall, "_discover_named_profiles", lambda: [])
|
|
monkeypatch.setattr(uninstall, "_perform_uninstall", _fail_if_called)
|
|
|
|
uninstall.run_uninstall(SimpleNamespace(dry_run=True, yes=True, full=True))
|
|
|
|
output = capsys.readouterr().out
|
|
assert called is False
|
|
assert "Dry run" in output
|
|
assert str(project_root) in output
|
|
assert str(hermes_home) in output
|
|
assert project_root.exists()
|
|
assert hermes_home.exists()
|
|
|
|
|
|
def test_build_uninstall_parser_accepts_dry_run():
|
|
import argparse
|
|
from hermes_cli.subcommands.uninstall import build_uninstall_parser
|
|
|
|
parser = argparse.ArgumentParser()
|
|
subparsers = parser.add_subparsers(dest="command")
|
|
build_uninstall_parser(subparsers, cmd_uninstall=lambda args: args)
|
|
|
|
args = parser.parse_args(["uninstall", "--dry-run", "--full"])
|
|
|
|
assert args.dry_run is True
|
|
assert args.full is True
|