Install then uninstall leaves no trace of graphify CODEBUDDY.md or hook.
(tmp_path)
| 320 | |
| 321 | |
| 322 | def test_codebuddy_installation_roundtrip(tmp_path): |
| 323 | """Install then uninstall leaves no trace of graphify CODEBUDDY.md or hook.""" |
| 324 | from graphify.__main__ import codebuddy_install, codebuddy_uninstall |
| 325 | # Pre-existing project file |
| 326 | _codebuddy_md_path(tmp_path).write_text("# My project\n") |
| 327 | # One section above graphify to test cleanup |
| 328 | codebuddy_install(tmp_path) |
| 329 | codebuddy_uninstall(tmp_path) |
| 330 | # CODEBUDDY.md should exist with original content only |
| 331 | md = _codebuddy_md_path(tmp_path) |
| 332 | assert md.exists() |
| 333 | content = md.read_text() |
| 334 | assert "## graphify" not in content |
| 335 | assert "# My project" in content |
| 336 | # Hook should be removed |
| 337 | settings_path = _settings_path(tmp_path) |
| 338 | if settings_path.exists(): |
| 339 | settings = json.loads(settings_path.read_text()) |
| 340 | hooks = settings.get("hooks", {}).get("PreToolUse", []) |
| 341 | assert not any("graphify" in str(h) for h in hooks) |
nothing calls this directly
no test coverage detected