Fix regexp for error put object with lock mode

Signed-off-by: Yulia Kovshova <y.kovshova@yadro.com>
This commit is contained in:
Юлия Ковшова 2022-10-11 08:18:08 +00:00 committed by Julia Kovshova
parent 0aeb998be9
commit ce41104d3a

View file

@ -851,14 +851,28 @@ class TestS3GateObject(TestS3GateBase):
with allure.step("Put object with lock-mode"):
with pytest.raises(
Exception,
match=r".*fetch time to epoch: time '0001-01-01T00:00:00Z' must be in the future.*",
match=r".*must both be supplied*",
):
# An error occurred (InternalError) when calling the PutObject operation (reached max retries: 2):
# fetch time to epoch: time '0001-01-01T00:00:00Z' must be in the future (after 2022-09-15T08:59:30Z)
# x-amz-object-lock-retain-until-date and x-amz-object-lock-mode must both be supplied
s3_gate_object.put_object_s3(
self.s3_client, bucket, file_path_1, ObjectLockMode="COMPLIANCE"
)
with allure.step("Put object with lock-mode and past date"):
date_obj = datetime.utcnow() - timedelta(days=3)
with pytest.raises(
Exception,
match=r".*until date must be in the future*",
):
# The retain until date must be in the future
s3_gate_object.put_object_s3(
self.s3_client,
bucket,
file_path_1,
ObjectLockMode="COMPLIANCE",
ObjectLockRetainUntilDate=date_obj,
)
@allure.title("Test S3 Sync directory")
@pytest.mark.parametrize("sync_type", ["sync", "cp"])
def test_s3_sync_dir(self, sync_type):