diff --git a/awscli/customizations/s3/subcommands.py b/awscli/customizations/s3/subcommands.py index bd3f60f16479..aed4a8a4f414 100644 --- a/awscli/customizations/s3/subcommands.py +++ b/awscli/customizations/s3/subcommands.py @@ -459,7 +459,7 @@ } CHECKSUM_ALGORITHM = { - 'name': 'checksum-algorithm', 'choices': ['CRC64NVME', 'CRC32', 'SHA256', 'SHA1', 'CRC32C', 'SHA512', 'XXHASH64', 'XXHASH3', 'XXHASH128'], + 'name': 'checksum-algorithm', 'choices': ['CRC64NVME', 'CRC32', 'SHA256', 'SHA1', 'CRC32C', 'SHA512', 'XXHASH64', 'XXHASH3', 'XXHASH128', 'MD5'], 'help_text': 'Indicates the algorithm used to create the checksum for the object.' } diff --git a/tests/unit/customizations/s3/test_subcommands.py b/tests/unit/customizations/s3/test_subcommands.py index 82d85bf6a25f..2389f8f7d25e 100644 --- a/tests/unit/customizations/s3/test_subcommands.py +++ b/tests/unit/customizations/s3/test_subcommands.py @@ -753,6 +753,14 @@ def test_validate_checksum_algorithm_download_error(self): cmd_params.add_paths(paths) self.assertIn('Expected checksum-algorithm parameter to be used with one of following path formats', cm.msg) + def test_validate_checksum_algorithm_md5_upload(self): + paths = [self.file_creator.rootdir, 's3://bucket/key'] + parameters = {'checksum_algorithm': 'MD5'} + cmd_params = CommandParameters('cp', parameters, '') + cmd_params.add_paths(paths) + self.assertEqual(cmd_params.parameters['checksum_algorithm'], 'MD5') + + def test_validate_checksum_algorithm_sync_download_error(self): paths = ['s3://bucket/key', self.file_creator.rootdir] parameters = {'checksum_algorithm': 'CRC32C'}