@@ -3650,36 +3650,34 @@ def _get_messages(amount: int) -> list[dict]:
36503650
36513651
36523652class TestSNSPlatformApplicationCrud :
3653- @markers .aws .manual_setup_required
3654- def test_create_platform_application (self , aws_client , snapshot , cleanups ):
3655- name = f"platform-application-{ short_uid ()} "
3656- platform = "ADM"
3653+ @pytest .fixture (scope = "class" )
3654+ def platform_credentials (self ) -> tuple [str , str ]:
36573655 # these values need to be extracted from a real amazon developer account if tested against AWS
36583656 # https://developer.amazon.com/settings/console/securityprofile/overview.html
36593657 client_id = "dummy"
36603658 client_secret = "dummy"
3659+ return client_id , client_secret
3660+
3661+ @markers .aws .manual_setup_required
3662+ def test_create_platform_application (
3663+ self , aws_client , snapshot , sns_create_platform_application , platform_credentials
3664+ ):
3665+ platform = "ADM"
3666+ # if tested against AWS, the fixture needs to contain real credentials
3667+ client_id , client_secret = platform_credentials
36613668 attributes = {"PlatformPrincipal" : client_id , "PlatformCredential" : client_secret }
3662- response = aws_client .sns .create_platform_application (
3663- Name = name , Platform = platform , Attributes = attributes
3664- )
3669+ response = sns_create_platform_application (Platform = platform , Attributes = attributes )
36653670 snapshot .match ("create-platform-application" , response )
3666- cleanups .append (
3667- lambda : aws_client .delete_platform_application (
3668- PlatformApplicationArn = response ["PlatformApplicationArn" ]
3669- )
3670- )
36713671
36723672 @pytest .mark .skipif (condition = is_sns_v1_provider (), reason = "Parity gap with old provider" )
36733673 @markers .aws .manual_setup_required
36743674 def test_list_platform_applications (
3675- self , aws_client , snapshot , sns_create_platform_application
3675+ self , aws_client , snapshot , sns_create_platform_application , platform_credentials
36763676 ):
36773677 name = f"platform-application-{ short_uid ()} "
36783678 platform = "ADM"
3679- # these values need to be extracted from a real amazon developer account if tested against AWS
3680- # https://developer.amazon.com/settings/console/securityprofile/overview.html
3681- client_id = "dummy"
3682- client_secret = "dummy"
3679+ # if tested against AWS, the fixture needs to contain real credentials
3680+ client_id , client_secret = platform_credentials
36833681 attributes = {"PlatformPrincipal" : client_id , "PlatformCredential" : client_secret }
36843682 sns_create_platform_application (Name = name , Platform = platform , Attributes = attributes )
36853683
@@ -3737,14 +3735,12 @@ def test_create_platform_application_invalid_platform(self, aws_client, snapshot
37373735 @pytest .mark .skipif (condition = is_sns_v1_provider (), reason = "Parity gap with old provider" )
37383736 @markers .aws .manual_setup_required
37393737 def test_get_platform_application_attributes (
3740- self , aws_client , snapshot , sns_create_platform_application
3738+ self , aws_client , snapshot , sns_create_platform_application , platform_credentials
37413739 ):
37423740 name = f"platform-application-{ short_uid ()} "
37433741 platform = "ADM"
3744- # these values need to be extracted from a real amazon developer account if tested against AWS
3745- # https://developer.amazon.com/settings/console/securityprofile/overview.html
3746- client_id = "dummy"
3747- client_secret = "dummy"
3742+ # if tested against AWS, the fixture needs to contain real credentials
3743+ client_id , client_secret = platform_credentials
37483744 attributes = {"PlatformPrincipal" : client_id , "PlatformCredential" : client_secret }
37493745 platform_application_arn = sns_create_platform_application (
37503746 Name = name , Platform = platform , Attributes = attributes
@@ -3774,14 +3770,12 @@ def test_get_platform_application_attributes_non_existing_app(
37743770 @pytest .mark .skipif (condition = is_sns_v1_provider (), reason = "Parity gap with old provider" )
37753771 @markers .aws .manual_setup_required
37763772 def test_set_platform_application_attributes (
3777- self , aws_client , snapshot , sns_create_platform_application
3773+ self , aws_client , snapshot , sns_create_platform_application , platform_credentials
37783774 ):
37793775 name = f"platform-application-{ short_uid ()} "
37803776 platform = "ADM"
3781- # these values need to be extracted from a real amazon developer account if tested against AWS
3782- # https://developer.amazon.com/settings/console/securityprofile/overview.html
3783- client_id = "dummy"
3784- client_secret = "dummy"
3777+ # if tested against AWS, the fixture needs to contain real credentials
3778+ client_id , client_secret = platform_credentials
37853779 attributes = {"PlatformPrincipal" : client_id , "PlatformCredential" : client_secret }
37863780 platform_application_arn = sns_create_platform_application (
37873781 Name = name , Platform = platform , Attributes = attributes
0 commit comments