Back to Black
This commit is contained in:
parent
ea489bce6c
commit
5697ff87a8
112 changed files with 1803 additions and 977 deletions
|
|
@ -48,8 +48,8 @@ else:
|
|||
|
||||
|
||||
def reduced_min_part_size(f):
|
||||
""" speed up tests by temporarily making the multipart minimum part size
|
||||
small
|
||||
"""speed up tests by temporarily making the multipart minimum part size
|
||||
small
|
||||
"""
|
||||
orig_size = s3model.UPLOAD_PART_MIN_SIZE
|
||||
|
||||
|
|
@ -1207,8 +1207,7 @@ if not settings.TEST_SERVER_MODE:
|
|||
with pytest.raises(ClientError) as ce:
|
||||
client.get_public_access_block(AccountId=ACCOUNT_ID)
|
||||
assert (
|
||||
ce.value.response["Error"]["Code"]
|
||||
== "NoSuchPublicAccessBlockConfiguration"
|
||||
ce.value.response["Error"]["Code"] == "NoSuchPublicAccessBlockConfiguration"
|
||||
)
|
||||
|
||||
# Put a with an invalid account ID:
|
||||
|
|
@ -1265,8 +1264,7 @@ if not settings.TEST_SERVER_MODE:
|
|||
with pytest.raises(ClientError) as ce:
|
||||
client.get_public_access_block(AccountId=ACCOUNT_ID)
|
||||
assert (
|
||||
ce.value.response["Error"]["Code"]
|
||||
== "NoSuchPublicAccessBlockConfiguration"
|
||||
ce.value.response["Error"]["Code"] == "NoSuchPublicAccessBlockConfiguration"
|
||||
)
|
||||
|
||||
@mock_s3
|
||||
|
|
@ -1465,9 +1463,7 @@ if not settings.TEST_SERVER_MODE:
|
|||
config_client.get_resource_config_history(
|
||||
resourceType="AWS::S3::AccountPublicAccessBlock", resourceId=ACCOUNT_ID
|
||||
)
|
||||
assert (
|
||||
ce.value.response["Error"]["Code"] == "ResourceNotDiscoveredException"
|
||||
)
|
||||
assert ce.value.response["Error"]["Code"] == "ResourceNotDiscoveredException"
|
||||
# aggregate
|
||||
result = config_client.batch_get_resource_config(
|
||||
resourceKeys=[
|
||||
|
|
@ -2402,7 +2398,9 @@ def test_boto3_get_object_if_match():
|
|||
|
||||
with pytest.raises(botocore.exceptions.ClientError) as err:
|
||||
s3.get_object(
|
||||
Bucket=bucket_name, Key=key, IfMatch='"hello"',
|
||||
Bucket=bucket_name,
|
||||
Key=key,
|
||||
IfMatch='"hello"',
|
||||
)
|
||||
e = err.value
|
||||
e.response["Error"]["Code"].should.equal("PreconditionFailed")
|
||||
|
|
@ -2421,7 +2419,9 @@ def test_boto3_get_object_if_none_match():
|
|||
|
||||
with pytest.raises(botocore.exceptions.ClientError) as err:
|
||||
s3.get_object(
|
||||
Bucket=bucket_name, Key=key, IfNoneMatch=etag,
|
||||
Bucket=bucket_name,
|
||||
Key=key,
|
||||
IfNoneMatch=etag,
|
||||
)
|
||||
e = err.value
|
||||
e.response["Error"].should.equal({"Code": "304", "Message": "Not Modified"})
|
||||
|
|
@ -2479,7 +2479,9 @@ def test_boto3_head_object_if_match():
|
|||
|
||||
with pytest.raises(botocore.exceptions.ClientError) as err:
|
||||
s3.head_object(
|
||||
Bucket=bucket_name, Key=key, IfMatch='"hello"',
|
||||
Bucket=bucket_name,
|
||||
Key=key,
|
||||
IfMatch='"hello"',
|
||||
)
|
||||
e = err.value
|
||||
e.response["Error"].should.equal({"Code": "412", "Message": "Precondition Failed"})
|
||||
|
|
@ -2497,7 +2499,9 @@ def test_boto3_head_object_if_none_match():
|
|||
|
||||
with pytest.raises(botocore.exceptions.ClientError) as err:
|
||||
s3.head_object(
|
||||
Bucket=bucket_name, Key=key, IfNoneMatch=etag,
|
||||
Bucket=bucket_name,
|
||||
Key=key,
|
||||
IfNoneMatch=etag,
|
||||
)
|
||||
e = err.value
|
||||
e.response["Error"].should.equal({"Code": "304", "Message": "Not Modified"})
|
||||
|
|
@ -3200,9 +3204,7 @@ def test_put_bucket_notification_errors():
|
|||
)
|
||||
|
||||
assert err.value.response["Error"]["Code"] == "InvalidArgument"
|
||||
assert (
|
||||
err.value.response["Error"]["Message"] == "The ARN is not well formed"
|
||||
)
|
||||
assert err.value.response["Error"]["Message"] == "The ARN is not well formed"
|
||||
|
||||
# Region not the same as the bucket:
|
||||
with pytest.raises(ClientError) as err:
|
||||
|
|
@ -4075,9 +4077,7 @@ def test_public_access_block():
|
|||
with pytest.raises(ClientError) as ce:
|
||||
client.get_public_access_block(Bucket="mybucket")
|
||||
|
||||
assert (
|
||||
ce.value.response["Error"]["Code"] == "NoSuchPublicAccessBlockConfiguration"
|
||||
)
|
||||
assert ce.value.response["Error"]["Code"] == "NoSuchPublicAccessBlockConfiguration"
|
||||
assert (
|
||||
ce.value.response["Error"]["Message"]
|
||||
== "The public access block configuration was not found"
|
||||
|
|
@ -4157,9 +4157,7 @@ def test_public_access_block():
|
|||
|
||||
with pytest.raises(ClientError) as ce:
|
||||
client.get_public_access_block(Bucket="mybucket")
|
||||
assert (
|
||||
ce.value.response["Error"]["Code"] == "NoSuchPublicAccessBlockConfiguration"
|
||||
)
|
||||
assert ce.value.response["Error"]["Code"] == "NoSuchPublicAccessBlockConfiguration"
|
||||
|
||||
|
||||
@mock_s3
|
||||
|
|
|
|||
|
|
@ -14,7 +14,12 @@ def test_s3_bucket_cloudformation_basic():
|
|||
|
||||
template = {
|
||||
"AWSTemplateFormatVersion": "2010-09-09",
|
||||
"Resources": {"testInstance": {"Type": "AWS::S3::Bucket", "Properties": {},}},
|
||||
"Resources": {
|
||||
"testInstance": {
|
||||
"Type": "AWS::S3::Bucket",
|
||||
"Properties": {},
|
||||
}
|
||||
},
|
||||
"Outputs": {"Bucket": {"Value": {"Ref": "testInstance"}}},
|
||||
}
|
||||
template_json = json.dumps(template)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue