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

Function _capture_query_settings

tests/test_query_cli.py:243–260  ·  view source on GitHub ↗
(monkeypatch, graph_path, flags)

Source from the content-addressed store, hash-verified

241 assert not out.startswith("Usage: graphify explain")
242# Project query defaults share the selected graph's identity, not process CWD.
243def _capture_query_settings(monkeypatch, graph_path, flags):
244 captured = {}
245
246 def query(_graph, _question, **kwargs):
247 captured["execution"] = kwargs
248 return "captured query result"
249
250 def log(**kwargs):
251 captured["log"] = kwargs
252
253 monkeypatch.setattr("graphify.serve._query_graph_text", query)
254 monkeypatch.setattr("graphify.querylog.log_query", log)
255 monkeypatch.setattr(mainmod, "_check_skill_version", lambda _: None)
256 monkeypatch.setattr(mainmod.sys, "argv", [
257 "graphify", "query", "extract", "--graph", str(graph_path), *flags,
258 ])
259 mainmod.main()
260 return captured
261
262
263@pytest.mark.parametrize("settings, flags, expected", [

Calls

no outgoing calls

Tested by

no test coverage detected