]> git-server-git.apps.pok.os.sepia.ceph.com Git - s3-tests.git/commitdiff
test_s3: basic cors test
authorYehuda Sadeh <yehuda@inktank.com>
Thu, 6 Jun 2013 18:19:05 +0000 (11:19 -0700)
committerYehuda Sadeh <yehuda@inktank.com>
Fri, 26 Jul 2013 04:53:33 +0000 (21:53 -0700)
related to issue #5261

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
requirements.txt
s3tests/functional/test_s3.py

index f81903bdd3243a6096d39ef821cdaf30abc9be63..81e93e94a7f8893d9e811fefd7416b6aa6840f5a 100644 (file)
@@ -1,6 +1,6 @@
 PyYAML
 nose >=1.0.0
-boto ==2.4.1
+boto >=2.6.0
 bunch >=1.0.0
 # 0.14 switches to libev, that means bootstrap needs to change too
 gevent ==0.13.6
index 7a8cd601d13f384c4eac7c3f7cee3fc37810b153..8c2c780726c0987fc5ffd770c52bde1e2ca9cd90 100644 (file)
@@ -34,6 +34,7 @@ import AnonymousAuth
 from email.header import decode_header
 from ordereddict import OrderedDict
 
+from boto.s3.cors import CORSConfiguration
 
 from . import (
     nuke_prefixed_buckets,
@@ -4247,6 +4248,21 @@ def test_stress_bucket_acls_changes():
     for i in xrange(10):
         _test_bucket_acls_changes_persistent(bucket);
 
+@attr(resource='bucket')
+@attr(method='put')
+@attr(operation='set cors')
+@attr(assertion='succeeds')
+def test_set_cors():
+    bucket = get_new_bucket()
+    cfg = CORSConfiguration()
+    cfg.add_rule('GET', '*')
+
+    e = assert_raises(boto.exception.S3ResponseError, bucket.get_cors)
+    eq(e.status, 404)
+
+    bucket.set_cors(cfg)
+    new_cfg = bucket.get_cors()
+
 class FakeFile(object):
     """
     file that simulates seek, tell, and current character