]> git-server-git.apps.pok.os.sepia.ceph.com Git - s3-tests.git/commitdiff
Add test for invalid copy part range 179/head
authorAndrew Gaul <andrew@gaul.org>
Wed, 2 Aug 2017 01:14:28 +0000 (18:14 -0700)
committerAndrew Gaul <andrew@gaul.org>
Wed, 2 Aug 2017 02:03:31 +0000 (19:03 -0700)
References kahing/goofys#212.

Signed-off-by: Andrew Gaul <andrew@gaul.org>
s3tests/functional/test_s3.py

index b8dc47fb320a9de61800e4ee3c4355e7b3ee64ec..2b6bd7e0f3ba2b575543d5f44b6f819bf7875b06 100644 (file)
@@ -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')