From c9fa19322e453abb78fbf7a0357ab2915606d1b5 Mon Sep 17 00:00:00 2001 From: Kevin DeJong Date: Wed, 11 Sep 2024 10:50:54 -0700 Subject: [PATCH] Improve testing --- .../resources/properties/hard_coded_arn_properties.yaml | 8 ++++++++ .../properties/hard_coded_arn_properties_sam.yaml | 8 -------- test/unit/rules/resources/test_hardcodedarnproperties.py | 1 + 3 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 test/fixtures/templates/good/resources/properties/hard_coded_arn_properties.yaml diff --git a/test/fixtures/templates/good/resources/properties/hard_coded_arn_properties.yaml b/test/fixtures/templates/good/resources/properties/hard_coded_arn_properties.yaml new file mode 100644 index 0000000000..2ad971962a --- /dev/null +++ b/test/fixtures/templates/good/resources/properties/hard_coded_arn_properties.yaml @@ -0,0 +1,8 @@ +Resources: + Authorizer: + Type: AWS::ApiGateway::Authorizer + Properties: + AuthorizerUri: !Sub arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:Name/invocations + RestApiId: RestApiId + Type: REQUEST + Name: Name diff --git a/test/fixtures/templates/good/resources/properties/hard_coded_arn_properties_sam.yaml b/test/fixtures/templates/good/resources/properties/hard_coded_arn_properties_sam.yaml index 9aee96cdfa..7dfad83771 100644 --- a/test/fixtures/templates/good/resources/properties/hard_coded_arn_properties_sam.yaml +++ b/test/fixtures/templates/good/resources/properties/hard_coded_arn_properties_sam.yaml @@ -104,11 +104,3 @@ Resources: start_position: "LATEST" aws: region: us-east-1 - - Authorizer: - Type: AWS::ApiGateway::Authorizer - Properties: - AuthorizerUri: !Sub arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/arn:${AWS::Partition}:lambda:${AWS::Region}:${AWS::AccountId}:function:Name/invocations - RestApiId: RestApiId - Type: REQUEST - Name: Name diff --git a/test/unit/rules/resources/test_hardcodedarnproperties.py b/test/unit/rules/resources/test_hardcodedarnproperties.py index ea8ad8a587..bee996d3e7 100644 --- a/test/unit/rules/resources/test_hardcodedarnproperties.py +++ b/test/unit/rules/resources/test_hardcodedarnproperties.py @@ -19,6 +19,7 @@ def setUp(self): super(TestHardCodedArnProperties, self).setUp() self.collection.register(HardCodedArnProperties()) self.success_templates = [ + "test/fixtures/templates/good/resources/properties/hard_coded_arn_properties.yaml", "test/fixtures/templates/good/resources/properties/hard_coded_arn_properties_sam.yaml", ]