Uninstall removes the PreToolUse hook from .codebuddy/settings.json.
(tmp_path)
| 191 | |
| 192 | |
| 193 | def test_codebuddy_uninstall_removes_hook(tmp_path): |
| 194 | """Uninstall removes the PreToolUse hook from .codebuddy/settings.json.""" |
| 195 | from graphify.__main__ import codebuddy_install, codebuddy_uninstall |
| 196 | codebuddy_install(tmp_path) |
| 197 | codebuddy_uninstall(tmp_path) |
| 198 | settings_path = _settings_path(tmp_path) |
| 199 | if settings_path.exists(): |
| 200 | settings = json.loads(settings_path.read_text()) |
| 201 | hooks = settings.get("hooks", {}).get("PreToolUse", []) |
| 202 | assert not any("graphify" in str(h) for h in hooks) |
| 203 | |
| 204 | |
| 205 | def test_codebuddy_uninstall_noop_if_not_installed(tmp_path): |
nothing calls this directly
no test coverage detected