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

Function test_global_remove

tests/test_global_graph.py:153–174  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

151
152
153def test_global_remove(tmp_path):
154 src_graph = tmp_path / "graph.json"
155 G = _make_graph([{"id": "userservice", "label": "UserService", "source_file": "src/user.py"}])
156 _graph_to_json(G, src_graph)
157
158 global_dir = tmp_path / ".graphify"
159 with patch("graphify.global_graph._GLOBAL_DIR", global_dir), \
160 patch("graphify.global_graph._GLOBAL_GRAPH", global_dir / "global-graph.json"), \
161 patch("graphify.global_graph._GLOBAL_MANIFEST", global_dir / "global-manifest.json"):
162 from graphify.global_graph import global_add, global_remove
163 global_add(src_graph, "repoA")
164 removed = global_remove("repoA")
165
166 assert removed > 0
167 # manifest should no longer list repoA - need to re-patch for list call
168 global_dir2 = global_dir # same dir
169 with patch("graphify.global_graph._GLOBAL_DIR", global_dir2), \
170 patch("graphify.global_graph._GLOBAL_GRAPH", global_dir2 / "global-graph.json"), \
171 patch("graphify.global_graph._GLOBAL_MANIFEST", global_dir2 / "global-manifest.json"):
172 from graphify.global_graph import global_list
173 repos = global_list()
174 assert "repoA" not in repos
175
176
177def test_global_remove_unknown_tag_raises(tmp_path):

Callers

nothing calls this directly

Calls 5

global_addFunction · 0.90
global_removeFunction · 0.90
global_listFunction · 0.90
_graph_to_jsonFunction · 0.85
_make_graphFunction · 0.70

Tested by

no test coverage detected