mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-22 09:29:43 +00:00
Merge pull request #77 from andrewgaul/special-key-names
Consolidate test_object_create_special_characters Reviewed-by: Yehuda Sadeh <yehuda@redhat.com>
This commit is contained in:
commit
44f2ce8281
1 changed files with 14 additions and 15 deletions
|
@ -926,20 +926,6 @@ def test_object_requestid_matchs_header_on_error():
|
||||||
request_id = re.search(r'<RequestId>(.*)</RequestId>', e.body.encode('utf-8')).group(1)
|
request_id = re.search(r'<RequestId>(.*)</RequestId>', e.body.encode('utf-8')).group(1)
|
||||||
eq(key.resp.getheader('x-amz-request-id'), request_id)
|
eq(key.resp.getheader('x-amz-request-id'), request_id)
|
||||||
|
|
||||||
@attr(resource='object')
|
|
||||||
@attr(method='put')
|
|
||||||
@attr(operation='write to special characters key')
|
|
||||||
@attr(assertion='fails 404')
|
|
||||||
def test_object_create_special_characters():
|
|
||||||
bucket = get_new_bucket()
|
|
||||||
# sourced from: http://xml.silmaril.ie/specials.html
|
|
||||||
key = bucket.new_key('<&>"\'')
|
|
||||||
key.set_contents_from_string('bar')
|
|
||||||
got = key.get_contents_as_string()
|
|
||||||
eq(got, 'bar')
|
|
||||||
bucket.get_all_keys()
|
|
||||||
|
|
||||||
|
|
||||||
# While the test itself passes, there's a SAX parser error during teardown. It
|
# While the test itself passes, there's a SAX parser error during teardown. It
|
||||||
# seems to be a boto bug. It happens with both amazon and dho.
|
# seems to be a boto bug. It happens with both amazon and dho.
|
||||||
# http://code.google.com/p/boto/issues/detail?id=501
|
# http://code.google.com/p/boto/issues/detail?id=501
|
||||||
|
@ -4490,7 +4476,20 @@ def test_bucket_recreate_not_overriding():
|
||||||
@attr(operation='create and list objects with special names')
|
@attr(operation='create and list objects with special names')
|
||||||
@attr(assertion='special names work')
|
@attr(assertion='special names work')
|
||||||
def test_bucket_create_special_key_names():
|
def test_bucket_create_special_key_names():
|
||||||
key_names = [' ', '%', '_', '_ ', '_ _', '__']
|
key_names = [
|
||||||
|
' ',
|
||||||
|
'"',
|
||||||
|
'$',
|
||||||
|
'%',
|
||||||
|
'&',
|
||||||
|
'\'',
|
||||||
|
'<',
|
||||||
|
'>',
|
||||||
|
'_',
|
||||||
|
'_ ',
|
||||||
|
'_ _',
|
||||||
|
'__',
|
||||||
|
]
|
||||||
bucket = _create_keys(keys=key_names)
|
bucket = _create_keys(keys=key_names)
|
||||||
|
|
||||||
li = bucket.list()
|
li = bucket.list()
|
||||||
|
|
Loading…
Reference in a new issue