mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-21 11:51:06 +00:00
Add range request to an empty object
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
This commit is contained in:
parent
56aa87d664
commit
21ade20826
1 changed files with 16 additions and 0 deletions
|
@ -6030,6 +6030,22 @@ def test_ranged_request_invalid_range():
|
||||||
eq(e.status, 416)
|
eq(e.status, 416)
|
||||||
eq(e.error_code, 'InvalidRange')
|
eq(e.error_code, 'InvalidRange')
|
||||||
|
|
||||||
|
@attr(resource='object')
|
||||||
|
@attr(method='get')
|
||||||
|
@attr(operation='range')
|
||||||
|
@attr(assertion='returns invalid range, 416')
|
||||||
|
def test_ranged_request_empty_object():
|
||||||
|
content = ''
|
||||||
|
|
||||||
|
bucket = get_new_bucket()
|
||||||
|
key = bucket.new_key('testobj')
|
||||||
|
key.set_contents_from_string(content)
|
||||||
|
|
||||||
|
# test invalid range
|
||||||
|
e = assert_raises(boto.exception.S3ResponseError, key.open, 'r', headers={'Range': 'bytes=40-50'})
|
||||||
|
eq(e.status, 416)
|
||||||
|
eq(e.error_code, 'InvalidRange')
|
||||||
|
|
||||||
def check_can_test_multiregion():
|
def check_can_test_multiregion():
|
||||||
if not targets.main.master or len(targets.main.secondaries) == 0:
|
if not targets.main.master or len(targets.main.secondaries) == 0:
|
||||||
raise SkipTest
|
raise SkipTest
|
||||||
|
|
Loading…
Reference in a new issue