From e208a74a050dccfe6af590f656b00de822f15251 Mon Sep 17 00:00:00 2001 From: Vasu Kulkarni Date: Fri, 3 Nov 2017 11:21:39 -0700 Subject: [PATCH] check for either 400 or 416 response code for invalid range test Signed-off-by: Vasu Kulkarni --- s3tests/functional/test_s3.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/s3tests/functional/test_s3.py b/s3tests/functional/test_s3.py index 915b9da..b2813ec 100644 --- a/s3tests/functional/test_s3.py +++ b/s3tests/functional/test_s3.py @@ -5351,9 +5351,14 @@ 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') + valid_status = [400, 416] + if not e.status in valid_status: + raise AssertionError("Invalid response " + str(status)) + valid_reason = ['Bad Request', 'Requested Range Not Satisfiable'] + if not e.reason in valid_reason: + raise AssertionError("Invalid reason " + e.reason ) + # no standard error code defined + # eq(e.error_code, 'InvalidArgument') @attr(resource='object') @attr(method='put')