graphify uninstall must clean up .codebuddy/settings.json hooks.
(tmp_path, monkeypatch)
| 252 | |
| 253 | |
| 254 | def test_uninstall_all_removes_codebuddy_hook(tmp_path, monkeypatch): |
| 255 | """graphify uninstall must clean up .codebuddy/settings.json hooks.""" |
| 256 | from graphify.__main__ import main |
| 257 | home = tmp_path / "home" |
| 258 | project = tmp_path / "project" |
| 259 | project.mkdir() |
| 260 | monkeypatch.chdir(project) |
| 261 | with patch("graphify.__main__.Path.home", return_value=home): |
| 262 | monkeypatch.setattr(sys, "argv", ["graphify", "codebuddy", "install"]) |
| 263 | main() |
| 264 | monkeypatch.setattr(sys, "argv", ["graphify", "uninstall"]) |
| 265 | main() |
| 266 | settings_path = _settings_path(project) |
| 267 | if settings_path.exists(): |
| 268 | settings = json.loads(settings_path.read_text()) |
| 269 | hooks = settings.get("hooks", {}).get("PreToolUse", []) |
| 270 | assert not any("graphify" in str(h) for h in hooks) |
| 271 | |
| 272 | |
| 273 | # --------------------------------------------------------------------------- |
nothing calls this directly
no test coverage detected