From 1fed8aebd3a93248ff00092da20cfbcb1a33b25e Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Sun, 15 Mar 2015 18:03:45 -0700 Subject: [PATCH] Test setting container ACLs during create bucket Signed-off-by: Andrew Gaul --- s3tests/functional/test_s3.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/s3tests/functional/test_s3.py b/s3tests/functional/test_s3.py index eb925bc..b155a05 100644 --- a/s3tests/functional/test_s3.py +++ b/s3tests/functional/test_s3.py @@ -2938,6 +2938,37 @@ def test_bucket_acl_default(): ) +@attr(resource='bucket') +@attr(method='get') +@attr(operation='public-read acl') +@attr(assertion='read back expected defaults') +def test_bucket_acl_canned_during_create(): + name = get_new_bucket_name() + bucket = targets.main.default.connection.create_bucket(name, policy = 'public-read') + policy = bucket.get_acl() + print repr(policy) + check_grants( + policy.acl.grants, + [ + dict( + permission='FULL_CONTROL', + id=policy.owner.id, + display_name=policy.owner.display_name, + uri=None, + email_address=None, + type='CanonicalUser', + ), + dict( + permission='READ', + id=None, + display_name=None, + uri='http://acs.amazonaws.com/groups/global/AllUsers', + email_address=None, + type='Group', + ), + ], + ) + @attr(resource='bucket') @attr(method='put') @attr(operation='acl: public-read,private')