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

Function test_log_query_appends

tests/test_querylog.py:56–67  ·  view source on GitHub ↗
(tmp_path, monkeypatch)

Source from the content-addressed store, hash-verified

54
55
56def test_log_query_appends(tmp_path, monkeypatch):
57 log_file = tmp_path / "q.log"
58 monkeypatch.setenv("GRAPHIFY_QUERY_LOG", str(log_file))
59 monkeypatch.delenv("GRAPHIFY_QUERY_LOG_DISABLE", raising=False)
60
61 log_query(kind="query", question="q1", corpus="/g.json")
62 log_query(kind="query", question="q2", corpus="/g.json")
63
64 lines = log_file.read_text().splitlines()
65 assert len(lines) == 2
66 assert json.loads(lines[0])["question"] == "q1"
67 assert json.loads(lines[1])["question"] == "q2"
68
69
70# ---------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 1

log_queryFunction · 0.90

Tested by

no test coverage detected