Files
claude-seo/tests/test_windows_uninstaller.py
3344796aaf fix(uninstall): report all removed Windows entries
Use local-scope foreach loops so the Windows uninstaller summary
counts every removed sub-skill directory and agent file.

Extend the hosted Windows smoke to verify dynamic full-install counts,
a partial install without the orchestrator, a clean empty rerun, and
filesystem removal.

Verified: 441 local tests and 28 focused tests passed; Ruff, YAML, and
diff checks passed; all seven exact-head hosted checks passed,
including native Windows full, partial, and empty uninstall behavior.
The initial hosted failure was confined to the new test expression and
was corrected before product code executed.

The v2.2.5 removal behavior remains unchanged. This corrects reporting
and adds regression coverage only.

Co-Authored-By: GPT-5 <noreply@openai.com>
2026-08-26 14:46:25 +03:00

27 lines
1014 B
Python

"""Static contracts for the Windows manual uninstaller."""
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def test_uninstaller_counts_removed_items_in_main_scope() -> None:
"""Pipeline child scopes must not lose counts before the summary is printed."""
text = (ROOT / "uninstall.ps1").read_text(encoding="utf-8")
assert "foreach ($subSkill in @(Get-ChildItem" in text
assert "foreach ($agentFile in @(Get-ChildItem" in text
assert "$removedSkills++" in text
assert "$removedAgents++" in text
assert "$script:removedSkills++" not in text
assert "$script:removedAgents++" not in text
def test_windows_smoke_checks_full_partial_and_empty_uninstalls() -> None:
text = (ROOT / ".github/workflows/windows-smoke.yml").read_text(encoding="utf-8")
assert "$expectedSummary" in text
assert "-Filter \"seo\" -ErrorAction SilentlyContinue) +" not in text
assert "Partial-install summary was incorrect" in text
assert "Nothing to remove" in text