Merge pull request #9 from andrewgaul/bucket-create-exists

test_bucket_create_exists should fail on recreate
This commit is contained in:
Alfredo Deza 2014-12-04 09:28:31 -05:00
commit 81dc4f4b24

View file

@ -2629,11 +2629,15 @@ def test_bucket_create_naming_dns_dash_dot():
@attr(resource='bucket')
@attr(method='put')
@attr(operation='re-create')
@attr(assertion='idempotent success')
@attr(assertion='fails 409')
def test_bucket_create_exists():
# aws-s3 default region allows recreation of buckets
# but all other regions fail with BucketAlreadyOwnedByYou.
bucket = get_new_bucket(targets.main.default)
# REST idempotency means this should be a nop
get_new_bucket(targets.main.default, bucket.name)
e = assert_raises(boto.exception.S3CreateError, get_new_bucket, targets.main.default, bucket.name)
eq(e.status, 409)
eq(e.reason, 'Conflict')
eq(e.error_code, 'BucketAlreadyOwnedByYou')
@attr(resource='bucket')