Skip to content

Commit 5d0a1be

Browse files
authored
test: add condition to run RestApi's SecurityPolicy tests (#3908)
1 parent 310934b commit 5d0a1be

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

integration/config/service_names.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@
3939
SNS_FILTER_POLICY_SCOPE = "SnsFilterPolicyScope"
4040
LOGS = "Logs"
4141
EVENT_RULE_WITH_EVENT_BUS = "EventRuleWithEventBus"
42+
SECURITY_POLICY_REST_API = "RestApiTlsPolicy"

integration/single/test_api_with_custom_domain_security_policy.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
from unittest.case import skipIf
22

3-
from integration.config.service_names import CUSTOM_DOMAIN
3+
from integration.config.service_names import CUSTOM_DOMAIN, SECURITY_POLICY_REST_API
44
from integration.helpers.base_internal_test import BaseInternalTest
55
from integration.helpers.base_test import nonblocking
6-
from integration.helpers.resource import current_region_not_included
6+
from integration.helpers.resource import current_region_does_not_support, current_region_not_included
77

88

99
@skipIf(
10-
current_region_not_included([CUSTOM_DOMAIN]),
11-
"Custom domain is not supported in this testing region",
10+
current_region_not_included([CUSTOM_DOMAIN]) or current_region_does_not_support([SECURITY_POLICY_REST_API]),
11+
"Custom domain or SecurityPolicy are not supported in this testing region",
1212
)
1313
@nonblocking
1414
class TestApiWithCustomDomainSecurityPolicy(BaseInternalTest):

integration/single/test_api_with_endpoint_access_mode.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
from unittest.case import skipIf
22

3-
from integration.config.service_names import REST_API
3+
from integration.config.service_names import REST_API, SECURITY_POLICY_REST_API
44
from integration.helpers.base_test import BaseTest
55
from integration.helpers.resource import current_region_does_not_support
66

77

8-
@skipIf(current_region_does_not_support([REST_API]), "Rest API is not supported in this testing region")
8+
@skipIf(
9+
current_region_does_not_support([REST_API, SECURITY_POLICY_REST_API]),
10+
"Rest API or SecurityPolicy are not supported in this testing region",
11+
)
912
class TestApiWithEndpointAccessMode(BaseTest):
1013
"""
1114
Tests for AWS::Serverless::Api with EndpointAccessMode property

0 commit comments

Comments
 (0)