MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / test_uninstall_all_removes_codebuddy_hook

Function test_uninstall_all_removes_codebuddy_hook

tests/test_codebuddy.py:254–270  ·  view source on GitHub ↗

graphify uninstall must clean up .codebuddy/settings.json hooks.

(tmp_path, monkeypatch)

Source from the content-addressed store, hash-verified

252
253
254def 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# ---------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 3

mainFunction · 0.90
_settings_pathFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected