diff --git a/src/frostfs_testlib/clients/s3/aws_cli_client.py b/src/frostfs_testlib/clients/s3/aws_cli_client.py index 3496b2b..accc289 100644 --- a/src/frostfs_testlib/clients/s3/aws_cli_client.py +++ b/src/frostfs_testlib/clients/s3/aws_cli_client.py @@ -1227,7 +1227,7 @@ class AwsCliClient(S3ClientWrapper): output = self.local_shell.exec(cmd).stdout response = self._to_json(output) - assert response.get("AttachedPolicies"), f"Expected AttachedPolicies in response:\n{response}" + assert "AttachedPolicies" in response.keys(), f"Expected AttachedPolicies in response:\n{response}" return response @@ -1239,7 +1239,7 @@ class AwsCliClient(S3ClientWrapper): output = self.local_shell.exec(cmd).stdout response = self._to_json(output) - assert response.get("AttachedPolicies"), f"Expected AttachedPolicies in response:\n{response}" + assert "AttachedPolicies" in response.keys(), f"Expected AttachedPolicies in response:\n{response}" return response @@ -1264,7 +1264,7 @@ class AwsCliClient(S3ClientWrapper): output = self.local_shell.exec(cmd).stdout response = self._to_json(output) - assert response.get("PolicyNames"), f"Expected PolicyNames in response:\n{response}" + assert "PolicyNames" in response.keys(), f"Expected PolicyNames in response:\n{response}" return response @@ -1276,7 +1276,7 @@ class AwsCliClient(S3ClientWrapper): output = self.local_shell.exec(cmd).stdout response = self._to_json(output) - assert response.get("Groups"), f"Expected Groups in response:\n{response}" + assert "Groups" in response.keys(), f"Expected Groups in response:\n{response}" return response @@ -1288,7 +1288,7 @@ class AwsCliClient(S3ClientWrapper): output = self.local_shell.exec(cmd).stdout response = self._to_json(output) - assert response.get("Groups"), f"Expected Groups in response:\n{response}" + assert "Groups" in response.keys(), f"Expected Groups in response:\n{response}" return response @@ -1324,7 +1324,7 @@ class AwsCliClient(S3ClientWrapper): output = self.local_shell.exec(cmd).stdout response = self._to_json(output) - assert response.get("PolicyNames"), f"Expected PolicyNames in response:\n{response}" + assert "PolicyNames" in response.keys(), f"Expected PolicyNames in response:\n{response}" return response diff --git a/src/frostfs_testlib/clients/s3/boto3_client.py b/src/frostfs_testlib/clients/s3/boto3_client.py index 53e7ffa..890b4e9 100644 --- a/src/frostfs_testlib/clients/s3/boto3_client.py +++ b/src/frostfs_testlib/clients/s3/boto3_client.py @@ -1091,7 +1091,7 @@ class Boto3ClientWrapper(S3ClientWrapper): endpoint=self.iam_endpoint, profile=self.profile, ) - assert response.get("AttachedPolicies"), f"Expected AttachedPolicies in response:\n{response}" + assert "AttachedPolicies" in response.keys(), f"Expected AttachedPolicies in response:\n{response}" return response @reporter.step("Lists all managed policies that are attached to the specified IAM user") @@ -1102,7 +1102,7 @@ class Boto3ClientWrapper(S3ClientWrapper): endpoint=self.iam_endpoint, profile=self.profile, ) - assert response.get("AttachedPolicies"), f"Expected AttachedPolicies in response:\n{response}" + assert "AttachedPolicies" in response.keys(), f"Expected AttachedPolicies in response:\n{response}" return response @reporter.step("Lists all IAM users, groups, and roles that the specified managed policy is attached to") @@ -1127,7 +1127,7 @@ class Boto3ClientWrapper(S3ClientWrapper): endpoint=self.iam_endpoint, profile=self.profile, ) - assert response.get("PolicyNames"), f"Expected PolicyNames in response:\n{response}" + assert "PolicyNames" in response.keys(), f"Expected PolicyNames in response:\n{response}" return response @reporter.step("Lists the IAM groups") @@ -1137,7 +1137,7 @@ class Boto3ClientWrapper(S3ClientWrapper): endpoint=self.iam_endpoint, profile=self.profile, ) - assert response.get("Groups"), f"Expected Groups in response:\n{response}" + assert "Groups" in response.keys(), f"Expected Groups in response:\n{response}" return response @reporter.step("Lists the IAM groups that the specified IAM user belongs to") @@ -1148,7 +1148,7 @@ class Boto3ClientWrapper(S3ClientWrapper): endpoint=self.iam_endpoint, profile=self.profile, ) - assert response.get("Groups"), f"Expected Groups in response:\n{response}" + assert "Groups" in response.keys(), f"Expected Groups in response:\n{response}" return response @reporter.step("Lists all the managed policies that are available in your AWS account") @@ -1180,7 +1180,7 @@ class Boto3ClientWrapper(S3ClientWrapper): endpoint=self.iam_endpoint, profile=self.profile, ) - assert response.get("PolicyNames"), f"Expected PolicyNames in response:\n{response}" + assert "PolicyNames" in response.keys(), f"Expected PolicyNames in response:\n{response}" return response @reporter.step("Lists the IAM users")