mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-21 23:29:47 +00:00
move ListBucket to new policy class
This commit is contained in:
parent
ecea466666
commit
26adb84b30
1 changed files with 4 additions and 4 deletions
|
@ -8970,14 +8970,14 @@ def test_bucket_policy_set_condition_operator_end_with_IfExists():
|
||||||
@attr('bucket-policy')
|
@attr('bucket-policy')
|
||||||
def test_bucket_policy_list_bucket_with_prefix():
|
def test_bucket_policy_list_bucket_with_prefix():
|
||||||
bucket = _create_keys(keys=['foo','folder/foo1','folder/foo2','folder/foo3','foo2'])
|
bucket = _create_keys(keys=['foo','folder/foo1','folder/foo2','folder/foo3','foo2'])
|
||||||
tag_conditional = {"StringEquals": {
|
conditional = {"StringEquals": {
|
||||||
"s3:prefix" : "folder"
|
"s3:prefix" : "folder"
|
||||||
}}
|
}}
|
||||||
|
|
||||||
resource = _make_arn_resource(bucket.name)
|
resource = _make_arn_resource(bucket.name)
|
||||||
policy_document = make_json_policy("s3:ListBucket",
|
p = Policy()
|
||||||
resource,
|
s = Statement("s3:ListBucket", resource, condition=conditional)
|
||||||
conditions=tag_conditional)
|
policy_document = p.add_statement(s).to_json()
|
||||||
|
|
||||||
eq(bucket.set_policy(policy_document), True)
|
eq(bucket.set_policy(policy_document), True)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue