Fix duplicate bucket creation with LocationConstraint. Closes #970.
This commit is contained in:
parent
49c947ece7
commit
113bfcb4ea
2 changed files with 22 additions and 0 deletions
|
|
@ -1207,6 +1207,22 @@ def test_boto3_bucket_create():
|
|||
"utf-8").should.equal("some text")
|
||||
|
||||
|
||||
@mock_s3
|
||||
def test_bucket_create_duplicate():
|
||||
s3 = boto3.resource('s3', region_name='us-west-2')
|
||||
s3.create_bucket(Bucket="blah", CreateBucketConfiguration={
|
||||
'LocationConstraint': 'us-west-2',
|
||||
})
|
||||
with assert_raises(ClientError) as exc:
|
||||
s3.create_bucket(
|
||||
Bucket="blah",
|
||||
CreateBucketConfiguration={
|
||||
'LocationConstraint': 'us-west-2',
|
||||
}
|
||||
)
|
||||
exc.exception.response['Error']['Code'].should.equal('BucketAlreadyExists')
|
||||
|
||||
|
||||
@mock_s3
|
||||
def test_boto3_bucket_create_eu_central():
|
||||
s3 = boto3.resource('s3', region_name='eu-central-1')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue