From 6ea711433e172adc72883b7ecc7f554d960e92c2 Mon Sep 17 00:00:00 2001 From: Ali Masarwa Date: Wed, 5 Feb 2025 10:49:01 +0200 Subject: [PATCH] rgw|BN: fix test to expect authorization failure Signed-off-by: Ali Masarwa --- s3tests_boto3/functional/test_sns.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/s3tests_boto3/functional/test_sns.py b/s3tests_boto3/functional/test_sns.py index 360f14e..589343b 100644 --- a/s3tests_boto3/functional/test_sns.py +++ b/s3tests_boto3/functional/test_sns.py @@ -85,14 +85,16 @@ def test_cross_account_topic(sns, sns_alt): name = get_new_topic_name() arn = sns.create_topic(Name=name)['TopicArn'] - # not visible to any alt user apis - with pytest.raises(sns.exceptions.NotFoundException): + # not authorized to any alt user apis + with pytest.raises(sns.exceptions.AuthorizationErrorException): sns_alt.get_topic_attributes(TopicArn=arn) - with pytest.raises(sns.exceptions.NotFoundException): + with pytest.raises(sns.exceptions.AuthorizationErrorException): sns_alt.set_topic_attributes(TopicArn=arn, AttributeName='Policy', AttributeValue='') + with pytest.raises(sns.exceptions.AuthorizationErrorException): + sns_alt.delete_topic(TopicArn=arn) # delete returns success - sns_alt.delete_topic(TopicArn=arn) + sns.delete_topic(TopicArn=arn) response = sns_alt.list_topics() assert arn not in [p['TopicArn'] for p in response['Topics']]