Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

test_s3: basic cors test

related to issue #5261

Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
  • Loading branch information...
commit 7bdf4b897a5c093923c721c0eaa2303180f88dd3 1 parent 9954bc4
Yehuda Sadeh yehudasa authored
Showing with 17 additions and 1 deletion.
  1. +1 −1  requirements.txt
  2. +16 −0 s3tests/functional/test_s3.py
2  requirements.txt
View
@@ -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
16 s3tests/functional/test_s3.py
View
@@ -36,6 +36,7 @@
from email.header import decode_header
from ordereddict import OrderedDict
+from boto.s3.cors import CORSConfiguration
from . import (
nuke_prefixed_buckets,
@@ -4252,6 +4253,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
Please sign in to comment.
Something went wrong with that request. Please try again.