mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2024-11-18 16:39:13 +00:00
better error reporting in graphql tests
This commit is contained in:
parent
1a65545c29
commit
2e59e7e880
|
@ -25,7 +25,13 @@ def assert_empty(response):
|
|||
|
||||
def assert_data(response):
|
||||
assert response.status_code == 200
|
||||
data = response.json().get("data")
|
||||
response = response.json()
|
||||
|
||||
if (
|
||||
"errors" in response.keys()
|
||||
): # convenience for debugging, this will display error
|
||||
raise ValueError(response["errors"])
|
||||
data = response.get("data")
|
||||
assert data is not None
|
||||
return data
|
||||
|
||||
|
|
Loading…
Reference in a new issue