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

Function run_graphql_error_test

python/test_utils/utils.py:151–166  ·  view source on GitHub ↗
(query, expected_error_message, graph)

Source from the content-addressed store, hash-verified

149
150
151def run_graphql_error_test(query, expected_error_message, graph):
152 tmp_work_dir = tempfile.mkdtemp()
153 with GraphServer(tmp_work_dir).start() as server:
154 client = server.get_client()
155 client.send_graph(path="g", graph=graph)
156
157 with pytest.raises(Exception) as excinfo:
158 client.query(query)
159
160 full_error_message = str(excinfo.value)
161 match = re.search(r'"message":"(.*?)"', full_error_message)
162 error_message = match.group(1) if match else ""
163
164 assert (
165 error_message == expected_error_message
166 ), f"Expected '{expected_error_message}', but got '{error_message}'"
167
168
169def run_group_graphql_error_test(queries_and_expected_error_messages, graph):

Calls 6

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