From 455cafa08a67f7ea1cf2e25d492767d6eeb10d41 Mon Sep 17 00:00:00 2001 From: Yulia Kovshova Date: Thu, 1 Dec 2022 11:58:05 +0300 Subject: [PATCH] add new test for 10 paths Signed-off-by: Yulia Kovshova --- .../services/s3_gate/test_s3_object.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pytest_tests/testsuites/services/s3_gate/test_s3_object.py b/pytest_tests/testsuites/services/s3_gate/test_s3_object.py index 3c1fe9b..19f9450 100644 --- a/pytest_tests/testsuites/services/s3_gate/test_s3_object.py +++ b/pytest_tests/testsuites/services/s3_gate/test_s3_object.py @@ -1,7 +1,8 @@ import os +import string import uuid from datetime import datetime, timedelta -from random import sample +from random import choices, sample import allure import pytest @@ -903,3 +904,16 @@ class TestS3GateObject(TestS3GateBase): # "FULL_CONTROL", # "FULL_CONTROL", # ], "Permission for all groups is FULL_CONTROL" + + @allure.title("Test S3 Put 10 nested level object") + def test_s3_put_10_folder(self, bucket, prepare_tmp_dir): + path = "/".join(["".join(choices(string.ascii_letters, k=3)) for _ in range(10)]) + file_path_1 = os.path.join(prepare_tmp_dir, path, "test_file_1") + generate_file_with_content(file_path=file_path_1) + file_name = self.object_key_from_file_path(file_path_1) + objects_list = s3_gate_object.list_objects_s3(self.s3_client, bucket) + assert not objects_list, f"Expected empty bucket, got {objects_list}" + + with allure.step("Put object"): + s3_gate_object.put_object_s3(self.s3_client, bucket, file_path_1) + check_objects_in_bucket(self.s3_client, bucket, [file_name])