Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion awscli/customizations/s3/subcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.'
}

Expand Down
8 changes: 8 additions & 0 deletions tests/unit/customizations/s3/test_subcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'}
Expand Down