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

Function run_graphql_error_test_contains

python/test_utils/utils.py:186–200  ·  view source on GitHub ↗
(query, expected_substrings, graph)

Source from the content-addressed store, hash-verified

184
185
186def run_graphql_error_test_contains(query, expected_substrings, graph):
187 tmp_work_dir = tempfile.mkdtemp()
188 with GraphServer(tmp_work_dir).start() as server:
189 client = server.get_client()
190 client.send_graph(path="g", graph=graph)
191
192 with pytest.raises(Exception) as excinfo:
193 client.query(query)
194
195 full_error_message = str(excinfo.value)
196 match = re.search(r'"message":"(.*?)"', full_error_message)
197 error_message = match.group(1) if match else ""
198
199 for s in expected_substrings:
200 assert s in error_message, f"expected to find {s!r} in {error_message!r}"
201
202
203def run_graphql_compare_test(query_a, query_b, graph):

Calls 6

GraphServerClass · 0.90
get_clientMethod · 0.80
startMethod · 0.45
send_graphMethod · 0.45
queryMethod · 0.45
groupMethod · 0.45