Merge pull request #655 from 2rs2ts/work-around-httpheaders

Remove HTTPHeaders from ResponseMetadata in some tests
This commit is contained in:
Steve Pulec 2016-07-24 09:36:58 -04:00 committed by GitHub
commit 8e8f3d99f6
3 changed files with 21 additions and 1 deletions

View file

@ -123,6 +123,7 @@ def test_create_function_from_aws_bucket():
"SubnetIds": ["subnet-123abc"],
},
)
result['ResponseMetadata'].pop('HTTPHeaders') # this is hard to match against, so remove it
result.should.equal({
'FunctionName': 'testFunction',
'FunctionArn': 'arn:aws:lambda:123456789012:function:testFunction',
@ -165,6 +166,7 @@ def test_create_function_from_zipfile():
MemorySize=128,
Publish=True,
)
result['ResponseMetadata'].pop('HTTPHeaders') # this is hard to match against, so remove it
result.should.equal({
'FunctionName': 'testFunction',
'FunctionArn': 'arn:aws:lambda:123456789012:function:testFunction',
@ -214,6 +216,7 @@ def test_get_function():
)
result = conn.get_function(FunctionName='testFunction')
result['ResponseMetadata'].pop('HTTPHeaders') # this is hard to match against, so remove it
result.should.equal({
"Code": {
@ -269,6 +272,7 @@ def test_delete_function():
)
success_result = conn.delete_function(FunctionName='testFunction')
success_result['ResponseMetadata'].pop('HTTPHeaders') # this is hard to match against, so remove it
success_result.should.equal({'ResponseMetadata': {'HTTPStatusCode': 204}})
conn.delete_function.when.called_with(FunctionName='testFunctionThatDoesntExist').should.throw(botocore.client.ClientError)
@ -332,7 +336,9 @@ def test_list_create_list_get_delete_list():
}
conn.list_functions()['Functions'].should.equal([expected_function_result['Configuration']])
conn.get_function(FunctionName='testFunction').should.equal(expected_function_result)
func = conn.get_function(FunctionName='testFunction')
func['ResponseMetadata'].pop('HTTPHeaders') # this is hard to match against, so remove it
func.should.equal(expected_function_result)
conn.delete_function(FunctionName='testFunction')
conn.list_functions()['Functions'].should.have.length_of(0)