From b068a0730179bfe18b246ae5a29e67ddc2c5caac Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Tue, 1 Aug 2017 18:14:28 -0700 Subject: [PATCH] Add test for invalid copy part range References kahing/goofys#212. Signed-off-by: Andrew Gaul --- s3tests/functional/test_s3.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/s3tests/functional/test_s3.py b/s3tests/functional/test_s3.py index b8dc47f..2b6bd7e 100644 --- a/s3tests/functional/test_s3.py +++ b/s3tests/functional/test_s3.py @@ -5328,6 +5328,17 @@ def test_multipart_copy_small(): eq(key2.size, size) _check_key_content(src_key, key2) +@attr(resource='object') +@attr(method='put') +@attr(operation='check multipart copies with an invalid range') +def test_multipart_copy_invalid_range(): + bucket, key = _create_key_with_random_content('source', size=5) + upload = bucket.initiate_multipart_upload('dest') + e = assert_raises(boto.exception.S3ResponseError, copy_part, bucket.name, key.name, bucket, 'dest', upload.id, 0, 0, 21) + eq(e.status, 400) + eq(e.reason, 'Bad Request') + eq(e.error_code, 'InvalidArgument') + @attr(resource='object') @attr(method='put') @attr(operation='check multipart copies with single small part')