Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s3_gate: Fix spelling errors #703

Merged
merged 2 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions dynamic_env_pytest_tests/tests/services/s3_gate/test_s3_bucket.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,26 @@ def pytest_generate_tests(metafunc):
class TestS3GateBucket(TestNeofsS3GateBase):
@pytest.mark.acl
@pytest.mark.sanity
@allure.title("Test S3: Create Bucket with different ACL")
@allure.title("Test S3: Create Bucket with various ACL")
def test_s3_create_bucket_with_ACL(self):

with allure.step("Create bucket with ACL private"):
acl="private"
with allure.step("Create bucket with ACL = private"):
acl = "private"
bucket = s3_gate_bucket.create_bucket_s3(self.s3_client, object_lock_enabled_for_bucket=True, acl=acl, bucket_configuration="rep-1")
bucket_acl = s3_gate_bucket.get_bucket_acl(self.s3_client, bucket)
assert_bucket_s3_acl(
acl_grants=bucket_acl, permitted_users="CanonicalUser", acl=acl
)

with allure.step("Create bucket with ACL = public-read"):
acl="public-read"
acl = "public-read"
bucket_1 = s3_gate_bucket.create_bucket_s3(self.s3_client, object_lock_enabled_for_bucket=True, acl=acl, bucket_configuration="rep-1")
bucket_acl_1 = s3_gate_bucket.get_bucket_acl(self.s3_client, bucket_1)
assert_bucket_s3_acl(
acl_grants=bucket_acl_1, permitted_users="AllUsers", acl=acl
)

with allure.step("Create bucket with ACL public-read-write"):
acl="public-read-write"
with allure.step("Create bucket with ACL = public-read-write"):
acl = "public-read-write"
bucket_2 = s3_gate_bucket.create_bucket_s3(
self.s3_client, object_lock_enabled_for_bucket=True, acl=acl, bucket_configuration="rep-1"
)
Expand All @@ -53,7 +52,7 @@ def test_s3_create_bucket_with_ACL(self):
)

with allure.step("Create bucket with ACL = authenticated-read"):
acl="authenticated-read"
acl = "authenticated-read"
bucket_3 = s3_gate_bucket.create_bucket_s3(
self.s3_client, object_lock_enabled_for_bucket=True, acl=acl, bucket_configuration="rep-1"
)
Expand All @@ -78,7 +77,7 @@ def test_s3_create_bucket_with_grands(self):
acl_grants=bucket_acl, permitted_users="AllUsers", acl="grant-read"
)

with allure.step("Create bucket with --grant-wtite"):
with allure.step("Create bucket with --grant-write"):
bucket_1 = s3_gate_bucket.create_bucket_s3(
self.s3_client,
object_lock_enabled_for_bucket=True,
Expand Down Expand Up @@ -150,11 +149,11 @@ def test_s3_delete_bucket(self, simple_object_size):
s3_gate_object.put_object_s3(self.s3_client, bucket, file_path_2)
check_objects_in_bucket(self.s3_client, bucket, [file_name_1, file_name_2])

with allure.step("Try to delete not empty bucket and get error"):
with allure.step("Try to delete not empty bucket and expect error"):
with pytest.raises(Exception, match=r".*The bucket you tried to delete is not empty.*"):
s3_gate_bucket.delete_bucket_s3(self.s3_client, bucket)

with allure.step("Delete object in bucket"):
with allure.step("Delete all objects in bucket"):
s3_gate_object.delete_object_s3(self.s3_client, bucket, file_name_1)
s3_gate_object.delete_object_s3(self.s3_client, bucket, file_name_2)
check_objects_in_bucket(self.s3_client, bucket, [])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def test_s3_buckets(self, simple_object_size):
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("Check buckets are visible with S3 head command"):
with allure.step("Check buckets are visible with S3 API HeadBucket op"):
s3_gate_bucket.head_bucket(self.s3_client, bucket_1)
s3_gate_bucket.head_bucket(self.s3_client, bucket_2)

Expand All @@ -73,7 +73,7 @@ def test_s3_buckets(self, simple_object_size):
file_name in bucket_objects
), f"Expected file {file_name} in objects list {bucket_objects}"

with allure.step("Try to delete not empty bucket and get error"):
with allure.step("Try to delete not empty bucket and expect error"):
with pytest.raises(Exception, match=r".*The bucket you tried to delete is not empty.*"):
s3_gate_bucket.delete_bucket_s3(self.s3_client, bucket_1)

Expand Down Expand Up @@ -157,7 +157,7 @@ def test_s3_sync_dir(self, bucket, simple_object_size):
with allure.step("Check these are the same objects"):
assert set(key_to_path.keys()) == set(
objects
), f"Expected all objects saved. Got {objects}"
), f"Expected exact objects saved. Got {objects}"
for obj_key in objects:
got_object = s3_gate_object.get_object_s3(self.s3_client, bucket, obj_key)
assert get_file_hash(got_object) == get_file_hash(
Expand Down Expand Up @@ -355,7 +355,7 @@ def test_s3_api_object_tagging(self, bucket, simple_object_size):
@allure.title("Test S3: Delete object & delete objects S3 API")
def test_s3_api_delete(self, two_buckets, simple_object_size, complex_object_size):
"""
Check delete_object and delete_objects S3 API operation. From first bucket some objects deleted one by one.
Check DeleteObject and DeleteObjects S3 API operations. From first bucket some objects deleted one by one.
From second bucket some objects deleted all at once.
"""
max_obj_count = 20
Expand Down
Loading