From 532d58abc7e6b6de376c50453979ceb560150575 Mon Sep 17 00:00:00 2001 From: Liza Date: Thu, 13 Apr 2023 16:50:08 +0300 Subject: [PATCH] Add check for Errors while deleting objects --- pytest_tests/steps/s3_gate_object.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pytest_tests/steps/s3_gate_object.py b/pytest_tests/steps/s3_gate_object.py index a15b380..2b6b170 100644 --- a/pytest_tests/steps/s3_gate_object.py +++ b/pytest_tests/steps/s3_gate_object.py @@ -168,6 +168,9 @@ def delete_objects_s3(s3_client, bucket: str, object_keys: list): response = s3_client.delete_objects(Bucket=bucket, Delete=_make_objs_dict(object_keys)) log_command_execution("S3 Delete objects result", response) sleep(S3_SYNC_WAIT_TIME) + assert ( + "Errors" not in response + ), f'The following objects have not been deleted: {[err_info["Key"] for err_info in response["Errors"]]}.\nError Message: {response["Errors"]["Message"]}' return response except ClientError as err: