API Gateway - Linting

This commit is contained in:
Bert Blommers 2019-11-04 02:02:07 -08:00
parent f0e2d44c5d
commit e4b586022d
2 changed files with 6 additions and 2 deletions

View File

@ -8,6 +8,7 @@ import requests
import time
from boto3.session import Session
try:
from urlparse import urlparse
except ImportError:
@ -731,7 +732,8 @@ class APIGatewayBackend(BaseBackend):
stage_variables = {}
api = self.get_rest_api(function_id)
methods = [
list(res.resource_methods.values()) for res in self.list_resources(function_id)
list(res.resource_methods.values())
for res in self.list_resources(function_id)
][0]
if not any(methods):
raise NoMethodDefined()

View File

@ -1026,7 +1026,9 @@ def test_delete_stage():
response["ResponseMetadata"]["HTTPStatusCode"].should.equal(202)
# verify other stage still exists
stages = client.get_stages(restApiId=api_id)["item"]
sorted([stage["stageName"] for stage in stages]).should.equal(sorted([new_stage_name, stage_name]))
sorted([stage["stageName"] for stage in stages]).should.equal(
sorted([new_stage_name, stage_name])
)
@mock_apigateway