]> git-server-git.apps.pok.os.sepia.ceph.com Git - s3-tests.git/commitdiff
move ListBucket to new policy class
authorAbhishek Lekshmanan <abhishek@suse.com>
Thu, 19 Oct 2017 14:25:42 +0000 (16:25 +0200)
committerAbhishek Lekshmanan <abhishek@suse.com>
Wed, 17 Jan 2018 09:56:32 +0000 (10:56 +0100)
s3tests/functional/test_s3.py

index 1b3253513c2e4925501e0adfa56f509753be093b..4165f99626bc408e78c81a80d6f87a28c4fb342c 100644 (file)
@@ -8970,14 +8970,14 @@ def test_bucket_policy_set_condition_operator_end_with_IfExists():
 @attr('bucket-policy')
 def test_bucket_policy_list_bucket_with_prefix():
     bucket = _create_keys(keys=['foo','folder/foo1','folder/foo2','folder/foo3','foo2'])
-    tag_conditional = {"StringEquals": {
+    conditional = {"StringEquals": {
         "s3:prefix" : "folder"
     }}
 
     resource = _make_arn_resource(bucket.name)
-    policy_document = make_json_policy("s3:ListBucket",
-                                       resource,
-                                       conditions=tag_conditional)
+    p = Policy()
+    s = Statement("s3:ListBucket", resource, condition=conditional)
+    policy_document = p.add_statement(s).to_json()
 
     eq(bucket.set_policy(policy_document), True)