mirror of
https://github.com/ceph/s3-tests.git
synced 2024-11-25 03:47:22 +00:00
Test empty and small multi-part uploads
This commit is contained in:
parent
ca2c0dc283
commit
673f7d7c44
1 changed files with 23 additions and 0 deletions
|
@ -4303,6 +4303,29 @@ def _multipart_upload(bucket, s3_key_name, size, part_size=5*1024*1024, do_list=
|
|||
|
||||
return upload
|
||||
|
||||
@attr(resource='object')
|
||||
@attr(method='put')
|
||||
@attr(operation='check multipart upload without parts')
|
||||
def test_multipart_upload_empty():
|
||||
bucket = get_new_bucket()
|
||||
key = "mymultipart"
|
||||
upload = _multipart_upload(bucket, key, 0)
|
||||
e = assert_raises(boto.exception.S3ResponseError, upload.complete_upload)
|
||||
eq(e.status, 400)
|
||||
eq(e.error_code, u'MalformedXML')
|
||||
|
||||
@attr(resource='object')
|
||||
@attr(method='put')
|
||||
@attr(operation='check multipart uploads with single small part')
|
||||
def test_multipart_upload_small():
|
||||
bucket = get_new_bucket()
|
||||
key = "mymultipart"
|
||||
size = 1
|
||||
upload = _multipart_upload(bucket, key, size)
|
||||
upload.complete_upload()
|
||||
key2 = bucket.get_key(key)
|
||||
eq(key2.size, size)
|
||||
|
||||
@attr(resource='object')
|
||||
@attr(method='put')
|
||||
@attr(operation='complete multi-part upload')
|
||||
|
|
Loading…
Reference in a new issue