-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
Description
I tried to use Moto to assert that a multipart upload was created through s3.Object.initiate_multipart_upload correctly, with a ChecksumAlgorithm
and a ChecksumType
set, but I found that the checksum parameters are not stored in the mock's state and not returned:
import boto3
from moto import mock_aws
with mock_aws():
s3 = boto3.resource("s3", region_name="us-east-1")
bucket = s3.create_bucket(Bucket="bucket")
s3.Object("bucket", "key").initiate_multipart_upload(
ChecksumAlgorithm="SHA256",
ChecksumType="COMPOSITE",
)
upload, = bucket.multipart_uploads.all()
# Expected: upload.checksum_algorithm=SHA256 upload.checksum_type=COMPOSITE
# Actual: upload.checksum_algorithm=None upload.checksum_type=None
print(f"{upload.checksum_algorithm=} {upload.checksum_type=}")