Ignore RetryAttempts field generated by recent botocore versions

This commit is contained in:
Taro Sato 2016-10-16 21:50:21 -07:00
parent b632df3aa4
commit ed91b093cd
3 changed files with 24 additions and 17 deletions

View File

@ -5,21 +5,6 @@ sure==1.2.24
coverage coverage
freezegun freezegun
flask flask
# botocore 1.4.29 breaks the following tests: boto3>=1.3.1
# test_nat_gateway.test_delete_nat_gateway botocore>=1.4.28
# test `list -> create -> list -> get -> delete -> list` integration
# test_lambda.test_get_function
# test_lambda.test_delete_function
# test_lambda.test_create_function_from_zipfile
# test_lambda.test_create_function_from_aws_bucket
# test_apigateway.test_integrations
# test_apigateway.test_integration_response
# test_apigateway.test_deployment
# test_apigateway.test_create_resource
# test_apigateway.test_create_method_response
# test_apigateway.test_create_method
# test_apigateway.test_child_resource
# so we need to pin a boto3 and botocore revision pair that we know works
boto3==1.3.1
botocore==1.4.28
six six

View File

@ -79,6 +79,7 @@ def test_create_resource():
resourceId=root_id, resourceId=root_id,
) )
root_resource['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it root_resource['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it
root_resource['ResponseMetadata'].pop('RetryAttempts', None)
root_resource.should.equal({ root_resource.should.equal({
'path': '/', 'path': '/',
'id': root_id, 'id': root_id,
@ -137,6 +138,7 @@ def test_child_resource():
resourceId=tags_id, resourceId=tags_id,
) )
child_resource['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it child_resource['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it
child_resource['ResponseMetadata'].pop('RetryAttempts', None)
child_resource.should.equal({ child_resource.should.equal({
'path': '/users/tags', 'path': '/users/tags',
'pathPart': 'tags', 'pathPart': 'tags',
@ -173,6 +175,7 @@ def test_create_method():
) )
response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it
response['ResponseMetadata'].pop('RetryAttempts', None)
response.should.equal({ response.should.equal({
'httpMethod': 'GET', 'httpMethod': 'GET',
'authorizationType': 'none', 'authorizationType': 'none',
@ -212,6 +215,7 @@ def test_create_method_response():
statusCode='200', statusCode='200',
) )
response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it
response['ResponseMetadata'].pop('RetryAttempts', None)
response.should.equal({ response.should.equal({
'ResponseMetadata': {'HTTPStatusCode': 200}, 'ResponseMetadata': {'HTTPStatusCode': 200},
'statusCode': '200' 'statusCode': '200'
@ -224,6 +228,7 @@ def test_create_method_response():
statusCode='200', statusCode='200',
) )
response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it
response['ResponseMetadata'].pop('RetryAttempts', None)
response.should.equal({ response.should.equal({
'ResponseMetadata': {'HTTPStatusCode': 200}, 'ResponseMetadata': {'HTTPStatusCode': 200},
'statusCode': '200' 'statusCode': '200'
@ -236,6 +241,7 @@ def test_create_method_response():
statusCode='200', statusCode='200',
) )
response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it
response['ResponseMetadata'].pop('RetryAttempts', None)
response.should.equal({'ResponseMetadata': {'HTTPStatusCode': 200}}) response.should.equal({'ResponseMetadata': {'HTTPStatusCode': 200}})
@ -273,6 +279,7 @@ def test_integrations():
uri='http://httpbin.org/robots.txt', uri='http://httpbin.org/robots.txt',
) )
response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it
response['ResponseMetadata'].pop('RetryAttempts', None)
response.should.equal({ response.should.equal({
'ResponseMetadata': {'HTTPStatusCode': 200}, 'ResponseMetadata': {'HTTPStatusCode': 200},
'httpMethod': 'GET', 'httpMethod': 'GET',
@ -294,6 +301,7 @@ def test_integrations():
httpMethod='GET' httpMethod='GET'
) )
response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it
response['ResponseMetadata'].pop('RetryAttempts', None)
response.should.equal({ response.should.equal({
'ResponseMetadata': {'HTTPStatusCode': 200}, 'ResponseMetadata': {'HTTPStatusCode': 200},
'httpMethod': 'GET', 'httpMethod': 'GET',
@ -314,6 +322,7 @@ def test_integrations():
resourceId=root_id, resourceId=root_id,
) )
response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it
response['ResponseMetadata'].pop('RetryAttempts', None)
response['resourceMethods']['GET']['methodIntegration'].should.equal({ response['resourceMethods']['GET']['methodIntegration'].should.equal({
'httpMethod': 'GET', 'httpMethod': 'GET',
'integrationResponses': { 'integrationResponses': {
@ -363,6 +372,7 @@ def test_integrations():
requestTemplates=templates requestTemplates=templates
) )
response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it
response['ResponseMetadata'].pop('RetryAttempts', None)
response['ResponseMetadata'].should.equal({'HTTPStatusCode': 200}) response['ResponseMetadata'].should.equal({'HTTPStatusCode': 200})
response = client.get_integration( response = client.get_integration(
@ -416,6 +426,7 @@ def test_integration_response():
selectionPattern='foobar', selectionPattern='foobar',
) )
response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it
response['ResponseMetadata'].pop('RetryAttempts', None)
response.should.equal({ response.should.equal({
'statusCode': '200', 'statusCode': '200',
'selectionPattern': 'foobar', 'selectionPattern': 'foobar',
@ -432,6 +443,7 @@ def test_integration_response():
statusCode='200', statusCode='200',
) )
response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it
response['ResponseMetadata'].pop('RetryAttempts', None)
response.should.equal({ response.should.equal({
'statusCode': '200', 'statusCode': '200',
'selectionPattern': 'foobar', 'selectionPattern': 'foobar',
@ -447,6 +459,7 @@ def test_integration_response():
httpMethod='GET', httpMethod='GET',
) )
response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it
response['ResponseMetadata'].pop('RetryAttempts', None)
response['methodIntegration']['integrationResponses'].should.equal({ response['methodIntegration']['integrationResponses'].should.equal({
'200': { '200': {
'responseTemplates': { 'responseTemplates': {
@ -495,6 +508,7 @@ def test_update_stage_configuration():
) )
response.pop('createdDate',None) # createdDate is hard to match against, remove it response.pop('createdDate',None) # createdDate is hard to match against, remove it
response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it
response['ResponseMetadata'].pop('RetryAttempts', None)
response.should.equal({ response.should.equal({
'id': deployment_id, 'id': deployment_id,
'ResponseMetadata': {'HTTPStatusCode': 200}, 'ResponseMetadata': {'HTTPStatusCode': 200},
@ -658,6 +672,7 @@ def test_create_stage():
) )
response.pop('createdDate',None) # createdDate is hard to match against, remove it response.pop('createdDate',None) # createdDate is hard to match against, remove it
response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it
response['ResponseMetadata'].pop('RetryAttempts', None)
response.should.equal({ response.should.equal({
'id': deployment_id, 'id': deployment_id,
'ResponseMetadata': {'HTTPStatusCode': 200}, 'ResponseMetadata': {'HTTPStatusCode': 200},
@ -677,6 +692,7 @@ def test_create_stage():
) )
response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it
response['ResponseMetadata'].pop('RetryAttempts', None)
response['items'][0].pop('createdDate') response['items'][0].pop('createdDate')
response['items'][1].pop('createdDate') response['items'][1].pop('createdDate')
@ -688,6 +704,7 @@ def test_create_stage():
response = client.create_stage(restApiId=api_id,stageName=new_stage_name,deploymentId=deployment_id2) response = client.create_stage(restApiId=api_id,stageName=new_stage_name,deploymentId=deployment_id2)
response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it
response['ResponseMetadata'].pop('RetryAttempts', None)
response.should.equal({ response.should.equal({
'stageName':new_stage_name, 'stageName':new_stage_name,
@ -712,6 +729,7 @@ def test_create_stage():
}) })
response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it
response['ResponseMetadata'].pop('RetryAttempts', None)
response.should.equal({ response.should.equal({
'stageName':new_stage_name_with_vars, 'stageName':new_stage_name_with_vars,
@ -737,6 +755,7 @@ def test_create_stage():
}, cacheClusterEnabled=True,description="hello moto") }, cacheClusterEnabled=True,description="hello moto")
response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it
response['ResponseMetadata'].pop('RetryAttempts', None)
response.should.equal({ response.should.equal({
'stageName':new_stage_name, 'stageName':new_stage_name,
@ -762,6 +781,7 @@ def test_create_stage():
}, cacheClusterEnabled=True,cacheClusterSize="1.6",description="hello moto") }, cacheClusterEnabled=True,cacheClusterSize="1.6",description="hello moto")
response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it
response['ResponseMetadata'].pop('RetryAttempts', None)
response.should.equal({ response.should.equal({
'stageName':new_stage_name, 'stageName':new_stage_name,
@ -807,6 +827,7 @@ def test_deployment():
) )
response.pop('createdDate',None) # createdDate is hard to match against, remove it response.pop('createdDate',None) # createdDate is hard to match against, remove it
response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it
response['ResponseMetadata'].pop('RetryAttempts', None)
response.should.equal({ response.should.equal({
'id': deployment_id, 'id': deployment_id,
'ResponseMetadata': {'HTTPStatusCode': 200}, 'ResponseMetadata': {'HTTPStatusCode': 200},

View File

@ -57,6 +57,7 @@ def test_delete_nat_gateway():
response = conn.delete_nat_gateway(NatGatewayId=nat_gateway_id) response = conn.delete_nat_gateway(NatGatewayId=nat_gateway_id)
response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it response['ResponseMetadata'].pop('HTTPHeaders', None) # this is hard to match against, so remove it
response['ResponseMetadata'].pop('RetryAttempts', None)
response.should.equal({ response.should.equal({
'NatGatewayId': nat_gateway_id, 'NatGatewayId': nat_gateway_id,
'ResponseMetadata': { 'ResponseMetadata': {