Remove HTTPHeaders from ResponseMetadata in some tests
botocore 1.4.29 started adding this. I'd match against it, but it contains a date object and it's just not worth rewriting the assertions for a key-by-key approach.
This commit is contained in:
parent
a9e54482fc
commit
aab137ae66
3 changed files with 21 additions and 1 deletions
|
|
@ -86,6 +86,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',
|
||||
|
|
@ -128,6 +129,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',
|
||||
|
|
@ -177,6 +179,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": {
|
||||
|
|
@ -232,6 +235,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)
|
||||
|
|
@ -295,7 +299,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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue