Show More
@@ -83,10 +83,14 b' def build_data(apikey, method, **kw):' | |||
|
83 | 83 | }) |
|
84 | 84 | |
|
85 | 85 | |
|
86 | def api_call(app, params, status=None): | |
|
86 | def api_call(app, params, status=None, assert_no_error=False): | |
|
87 | 87 | response = app.post( |
|
88 | 88 | API_URL, content_type='application/json', params=params, status=status, |
|
89 | 89 | headers=[('Content-Type', 'application/json')]) |
|
90 | if assert_no_error: | |
|
91 | err_resp = response.json.get('error') | |
|
92 | if err_resp: | |
|
93 | raise AssertionError(f'ERROR in response: {err_resp}') | |
|
90 | 94 | return response |
|
91 | 95 | |
|
92 | 96 |
General Comments 0
You need to be logged in to leave comments.
Login now