From 5f7ea2b77f0c028d1b67089c252a7efd7dbf0527 Mon Sep 17 00:00:00 2001 From: Hugo Lopes Tavares Date: Tue, 16 Feb 2016 15:24:41 -0500 Subject: [PATCH] [lambda] Fix HTTP code of CreateFunction --- moto/awslambda/responses.py | 2 +- tests/test_awslambda/__init__.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/moto/awslambda/responses.py b/moto/awslambda/responses.py index ec60af8d3..13457820a 100644 --- a/moto/awslambda/responses.py +++ b/moto/awslambda/responses.py @@ -41,7 +41,7 @@ class LambdaResponse(BaseResponse): spec = json.loads(request.body) fn = lambda_backend.create_function(spec) config = fn.get_configuration() - return 200, headers, json.dumps(config) + return 201, headers, json.dumps(config) def _delete_function(self, request, full_url, headers): lambda_backend = self.get_lambda_backend(full_url) diff --git a/tests/test_awslambda/__init__.py b/tests/test_awslambda/__init__.py index 9306e8a69..e4d254ddf 100644 --- a/tests/test_awslambda/__init__.py +++ b/tests/test_awslambda/__init__.py @@ -64,7 +64,7 @@ def test_create_function_from_aws_bucket(): # "VpcId": "vpc-123abc" # }, - 'ResponseMetadata': {'HTTPStatusCode': 200}, + 'ResponseMetadata': {'HTTPStatusCode': 201}, }) @@ -120,7 +120,7 @@ def handler(event, context): # "VpcId": "vpc-123abc" # }, - 'ResponseMetadata': {'HTTPStatusCode': 200}, + 'ResponseMetadata': {'HTTPStatusCode': 201}, })