Merge pull request #2114 from cm-iwata/fix_lambda_publish_version
Fix lambda publish_version returns wrong status code
This commit is contained in:
commit
65525cb611
@ -183,7 +183,7 @@ class LambdaResponse(BaseResponse):
|
||||
fn = self.lambda_backend.publish_function(function_name)
|
||||
if fn:
|
||||
config = fn.get_configuration()
|
||||
return 200, {}, json.dumps(config)
|
||||
return 201, {}, json.dumps(config)
|
||||
else:
|
||||
return 404, {}, "{}"
|
||||
|
||||
|
@ -471,7 +471,8 @@ def test_publish():
|
||||
function_list['Functions'].should.have.length_of(1)
|
||||
latest_arn = function_list['Functions'][0]['FunctionArn']
|
||||
|
||||
conn.publish_version(FunctionName='testFunction')
|
||||
res = conn.publish_version(FunctionName='testFunction')
|
||||
assert res['ResponseMetadata']['HTTPStatusCode'] == 201
|
||||
|
||||
function_list = conn.list_functions()
|
||||
function_list['Functions'].should.have.length_of(2)
|
||||
@ -853,8 +854,8 @@ def test_list_versions_by_function():
|
||||
Publish=True,
|
||||
)
|
||||
|
||||
conn.publish_version(FunctionName='testFunction')
|
||||
|
||||
res = conn.publish_version(FunctionName='testFunction')
|
||||
assert res['ResponseMetadata']['HTTPStatusCode'] == 201
|
||||
versions = conn.list_versions_by_function(FunctionName='testFunction')
|
||||
|
||||
assert versions['Versions'][0]['FunctionArn'] == 'arn:aws:lambda:us-west-2:123456789012:function:testFunction:$LATEST'
|
||||
|
Loading…
Reference in New Issue
Block a user