Fix s3 Added Error handling in case of invalid uploadID (#2979)
* Added Error handling in case of invalid uploadID * Linting * added assertions * Linting Co-authored-by: usmankb <usman@krazybee.com> Co-authored-by: Bert Blommers <info@bertblommers.nl>
This commit is contained in:
parent
e73a694219
commit
774a764b69
3 changed files with 26 additions and 0 deletions
|
|
@ -2149,6 +2149,19 @@ def test_boto3_copy_object_with_versioning():
|
|||
data.should.equal(b"test2")
|
||||
|
||||
|
||||
@mock_s3
|
||||
def test_s3_abort_multipart_data_with_invalid_upload_and_key():
|
||||
client = boto3.client("s3", region_name=DEFAULT_REGION_NAME)
|
||||
|
||||
client.create_bucket(Bucket="blah")
|
||||
|
||||
with assert_raises(Exception) as err:
|
||||
client.abort_multipart_upload(
|
||||
Bucket="blah", Key="foobar", UploadId="dummy_upload_id"
|
||||
)
|
||||
err.exception.response["Error"]["Code"].should.equal("NoSuchUpload")
|
||||
|
||||
|
||||
@mock_s3
|
||||
def test_boto3_copy_object_from_unversioned_to_versioned_bucket():
|
||||
client = boto3.client("s3", region_name=DEFAULT_REGION_NAME)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue