MCPcopy Create free account
hub / github.com/Pometry/Raphtory / run_graphql_compare_test

Function run_graphql_compare_test

python/test_utils/utils.py:203–219  ·  view source on GitHub ↗
(query_a, query_b, graph)

Source from the content-addressed store, hash-verified

201
202
203def run_graphql_compare_test(query_a, query_b, graph):
204 tmp_work_dir = tempfile.mkdtemp()
205 with GraphServer(tmp_work_dir).start() as server:
206 client = server.get_client()
207 client.send_graph(path="g", graph=graph)
208
209 resp_a = client.query(query_a)
210 resp_b = client.query(query_b)
211
212 dict_a = json.loads(resp_a) if isinstance(resp_a, str) else resp_a
213 dict_b = json.loads(resp_b) if isinstance(resp_b, str) else resp_b
214
215 assert sort_dict_recursive(dict_a) == sort_dict_recursive(dict_b), (
216 f"Query A != Query B\n"
217 f"A={sort_dict_recursive(dict_a)}\n"
218 f"B={sort_dict_recursive(dict_b)}"
219 )
220
221
222def assert_set_eq(left, right):

Callers

nothing calls this directly

Calls 6

GraphServerClass · 0.90
sort_dict_recursiveFunction · 0.85
get_clientMethod · 0.80
startMethod · 0.45
send_graphMethod · 0.45
queryMethod · 0.45

Tested by

no test coverage detected