mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-21 23:29:47 +00:00
test_s3: basic cors test
related to issue #5261 Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
This commit is contained in:
parent
48ba5dafc4
commit
a62df16023
2 changed files with 17 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
PyYAML
|
PyYAML
|
||||||
nose >=1.0.0
|
nose >=1.0.0
|
||||||
boto ==2.4.1
|
boto >=2.6.0
|
||||||
bunch >=1.0.0
|
bunch >=1.0.0
|
||||||
# 0.14 switches to libev, that means bootstrap needs to change too
|
# 0.14 switches to libev, that means bootstrap needs to change too
|
||||||
gevent ==0.13.6
|
gevent ==0.13.6
|
||||||
|
|
|
@ -34,6 +34,7 @@ import AnonymousAuth
|
||||||
from email.header import decode_header
|
from email.header import decode_header
|
||||||
from ordereddict import OrderedDict
|
from ordereddict import OrderedDict
|
||||||
|
|
||||||
|
from boto.s3.cors import CORSConfiguration
|
||||||
|
|
||||||
from . import (
|
from . import (
|
||||||
nuke_prefixed_buckets,
|
nuke_prefixed_buckets,
|
||||||
|
@ -4247,6 +4248,21 @@ def test_stress_bucket_acls_changes():
|
||||||
for i in xrange(10):
|
for i in xrange(10):
|
||||||
_test_bucket_acls_changes_persistent(bucket);
|
_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):
|
class FakeFile(object):
|
||||||
"""
|
"""
|
||||||
file that simulates seek, tell, and current character
|
file that simulates seek, tell, and current character
|
||||||
|
|
Loading…
Reference in a new issue