mirror of
https://github.com/qdrant/qdrant.git
synced 2026-09-27 08:27:40 -05:00
* Use systematically assert_http_ok for better error reporting * extraction assertion to use it outside of pytest
11 lines
388 B
Python
11 lines
388 B
Python
import requests
|
|
|
|
|
|
def assert_http_ok(response: requests.Response):
|
|
if response.status_code != 200:
|
|
if not response.content:
|
|
raise Exception(f"Http request failed with status {response.status_code} and no content")
|
|
else:
|
|
raise Exception(
|
|
f"Http request failed with status {response.status_code} and content:\n{response.json()}")
|