| 184 | |
| 185 | |
| 186 | def 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 | |
| 203 | def run_graphql_compare_test(query_a, query_b, graph): |