From e4b586022d192755bb681581429ef71d5ae2cbd1 Mon Sep 17 00:00:00 2001 From: Bert Blommers Date: Mon, 4 Nov 2019 02:02:07 -0800 Subject: [PATCH] API Gateway - Linting --- moto/apigateway/models.py | 4 +++- tests/test_apigateway/test_apigateway.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/moto/apigateway/models.py b/moto/apigateway/models.py index dca80a234..6f1d01c4f 100644 --- a/moto/apigateway/models.py +++ b/moto/apigateway/models.py @@ -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() diff --git a/tests/test_apigateway/test_apigateway.py b/tests/test_apigateway/test_apigateway.py index 2d72c3efe..de99f1fcf 100644 --- a/tests/test_apigateway/test_apigateway.py +++ b/tests/test_apigateway/test_apigateway.py @@ -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