Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions integration/combination/test_api_settings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import hashlib
from unittest.case import skipIf

from integration.helpers.resource import current_region_does_not_support
from integration.config.service_names import REST_API

try:
from pathlib import Path
Expand All @@ -10,6 +14,7 @@
from integration.helpers.base_test import BaseTest


@skipIf(current_region_does_not_support([REST_API]), "Rest API is not supported in this testing region")
class TestApiSettings(BaseTest):
def test_method_settings(self):
self.create_and_verify_stack("combination/api_with_method_settings")
Expand Down
4 changes: 4 additions & 0 deletions integration/combination/test_api_with_cors.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import requests
from unittest.case import skipIf

from integration.helpers.base_test import BaseTest
from integration.helpers.resource import current_region_does_not_support
from integration.config.service_names import REST_API
from integration.helpers.deployer.utils.retry import retry
from parameterized import parameterized

Expand All @@ -9,6 +12,7 @@
ALL_METHODS = "DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT"


@skipIf(current_region_does_not_support([REST_API]), "Rest API is not supported in this testing region")
class TestApiWithCors(BaseTest):
@parameterized.expand(
[
Expand Down
4 changes: 4 additions & 0 deletions integration/combination/test_api_with_resource_policies.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import json
from unittest.case import skipIf

from integration.helpers.base_test import BaseTest
from integration.helpers.resource import current_region_does_not_support
from integration.config.service_names import REST_API


@skipIf(current_region_does_not_support([REST_API]), "Rest API is not supported in this testing region")
class TestApiWithResourcePolicies(BaseTest):
def test_api_resource_policies(self):
self.create_and_verify_stack("combination/api_with_resource_policies")
Expand Down
4 changes: 4 additions & 0 deletions integration/combination/test_function_with_alias.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import json
from unittest.case import skipIf

from botocore.exceptions import ClientError
from integration.helpers.base_test import BaseTest, LOG
from integration.helpers.common_api import get_function_versions
from integration.helpers.resource import current_region_does_not_support
from integration.config.service_names import REST_API


class TestFunctionWithAlias(BaseTest):
Expand Down Expand Up @@ -82,6 +85,7 @@ def test_alias_in_globals_with_overrides(self):
# add any extra runtime behavior that needs to be verified
self.create_and_verify_stack("combination/function_with_alias_globals")

@skipIf(current_region_does_not_support([REST_API]), "Rest API is not supported in this testing region")
def test_alias_with_event_sources_get_correct_permissions(self):
# There are two parts to testing Event Source integrations:
# 1. Check if all event sources get wired to the alias
Expand Down
5 changes: 5 additions & 0 deletions integration/combination/test_function_with_api.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
from unittest.case import skipIf

from integration.helpers.base_test import BaseTest
from integration.helpers.resource import current_region_does_not_support
from integration.config.service_names import REST_API


@skipIf(current_region_does_not_support([REST_API]), "Rest API is not supported in this testing region")
class TestFunctionWithApi(BaseTest):
def test_function_with_api(self):
self.create_and_verify_stack("combination/function_with_api")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
from unittest.case import skipIf

from integration.helpers.base_test import BaseTest
from integration.helpers.resource import current_region_does_not_support
from integration.config.service_names import REST_API


@skipIf(current_region_does_not_support([REST_API]), "Rest API is not supported in this testing region")
class TestFunctionWithImplicitApiAndCondition(BaseTest):
def test_function_with_implicit_api_and_conditions(self):
self.create_and_verify_stack("combination/function_with_implicit_api_and_conditions")
4 changes: 4 additions & 0 deletions integration/combination/test_intrinsic_function_support.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
from parameterized import parameterized
from unittest.case import skipIf

from integration.helpers.base_test import BaseTest
from integration.helpers.resource import current_region_does_not_support
from integration.config.service_names import REST_API


@skipIf(current_region_does_not_support([REST_API]), "Rest API is not supported in this testing region")
class TestIntrinsicFunctionsSupport(BaseTest):

# test code definition uri object and serverless function properties support
Expand Down
7 changes: 5 additions & 2 deletions integration/combination/test_resource_references.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
from integration.helpers.base_test import BaseTest

from unittest.case import skipIf

from integration.helpers.base_test import BaseTest
from integration.helpers.common_api import get_function_versions
from integration.helpers.resource import current_region_does_not_support
from integration.config.service_names import REST_API


# Tests resource references support of SAM Function resource
Expand Down Expand Up @@ -35,6 +37,7 @@ def test_function_alias_references(self):
self.assertEqual(stack_outputs["VersionNumber"], version_number)
self.assertEqual(stack_outputs["VersionArn"], version_arn)

@skipIf(current_region_does_not_support([REST_API]), "Rest API is not supported in this testing region")
def test_api_with_resource_references(self):
self.create_and_verify_stack("combination/api_with_resource_refs")

Expand Down
1 change: 1 addition & 0 deletions integration/config/service_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
XRAY = "XRay"
LAYERS = "Layers"
HTTP_API = "HttpApi"
REST_API = "RestApi"
IOT = "IoT"
CODE_DEPLOY = "CodeDeploy"
ARM = "ARM"
Expand Down
3 changes: 2 additions & 1 deletion integration/single/test_basic_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
from integration.helpers.base_test import BaseTest

from integration.helpers.resource import current_region_does_not_support
from integration.config.service_names import MODE
from integration.config.service_names import MODE, REST_API


@skipIf(current_region_does_not_support([REST_API]), "Rest API is not supported in this testing region")
class TestBasicApi(BaseTest):
"""
Basic AWS::Serverless::Api tests
Expand Down