Fixed rare bug in tests

Fixed a rare bug in create_delete_art.py when deleting entries. In some circumstances it would still report to be successful while failing to delete.
master
Peery 3 years ago
parent b8e07eb528
commit 458f48a8f7

@ -82,8 +82,8 @@ def delete_art_entries(url: str, port: int):
else:
r = delete_art_by_hash(url, port, md5_hash=arts[i]["hash"])
if r is not None and r.status_code != 200:
raise Exception(f"Could not delete the art! {r.status_code}, {r.text}")
if r.status_code != 200:
raise Exception(f"Could not delete the art! {r.status_code}, {r.text}")
print("Deleted art entries: SUCCESS")
@ -129,7 +129,7 @@ def delete_art_by_hash(url: str, port: int, md5_hash: str):
data = json.loads(str(r1.text))
art_id = data['id']
r = requests.delete(f"http://{url}:{port}/artnet/metadata/art?id={art_id}")
r = delete_art_by_id(url, port, art_id=art_id)
return r

Loading…
Cancel
Save