Skip to content

Commit

Permalink
Merge branch 'release-1.16.61-customizations' into release-1.16.61
Browse files Browse the repository at this point in the history
  • Loading branch information
joguSD committed Nov 26, 2018
2 parents 96e950b + 71f970f commit 9686be9
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 2 deletions.
4 changes: 2 additions & 2 deletions awscli/customizations/s3/subcommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,11 +249,11 @@

STORAGE_CLASS = {'name': 'storage-class',
'choices': ['STANDARD', 'REDUCED_REDUNDANCY', 'STANDARD_IA',
'ONEZONE_IA'],
'ONEZONE_IA', 'INTELLIGENT_TIERING'],
'help_text': (
"The type of storage to use for the object. "
"Valid choices are: STANDARD | REDUCED_REDUNDANCY "
"| STANDARD_IA | ONEZONE_IA. "
"| STANDARD_IA | ONEZONE_IA | INTELLIGENT_TIERING. "
"Defaults to 'STANDARD'")}


Expand Down
30 changes: 30 additions & 0 deletions tests/functional/s3/test_cp_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,21 @@ def test_upload_expires(self):
self.assertEqual(self.operations_called[0][1]['Bucket'], 'bucket')
self.assertEqual(self.operations_called[0][1]['Expires'], '90')

def test_upload_standard_ia(self):
full_path = self.files.create_file('foo.txt', 'mycontent')
cmdline = ('%s %s s3://bucket/key.txt --storage-class STANDARD_IA' %
(self.prefix, full_path))
self.parsed_responses = \
[{'ETag': '"c8afdb36c52cf4727836669019e69222"'}]
self.run_cmd(cmdline, expected_rc=0)
self.assertEqual(len(self.operations_called), 1,
self.operations_called)
self.assertEqual(self.operations_called[0][0].name, 'PutObject')
args = self.operations_called[0][1]
self.assertEqual(args['Key'], 'key.txt')
self.assertEqual(args['Bucket'], 'bucket')
self.assertEqual(args['StorageClass'], 'STANDARD_IA')

def test_upload_onezone_ia(self):
full_path = self.files.create_file('foo.txt', 'mycontent')
cmdline = ('%s %s s3://bucket/key.txt --storage-class ONEZONE_IA' %
Expand All @@ -114,6 +129,21 @@ def test_upload_onezone_ia(self):
self.assertEqual(args['Bucket'], 'bucket')
self.assertEqual(args['StorageClass'], 'ONEZONE_IA')

def test_upload_intelligent_tiering(self):
full_path = self.files.create_file('foo.txt', 'mycontent')
cmdline = ('%s %s s3://bucket/key.txt --storage-class INTELLIGENT_TIERING' %
(self.prefix, full_path))
self.parsed_responses = \
[{'ETag': '"c8afdb36c52cf4727836669019e69222"'}]
self.run_cmd(cmdline, expected_rc=0)
self.assertEqual(len(self.operations_called), 1,
self.operations_called)
self.assertEqual(self.operations_called[0][0].name, 'PutObject')
args = self.operations_called[0][1]
self.assertEqual(args['Key'], 'key.txt')
self.assertEqual(args['Bucket'], 'bucket')
self.assertEqual(args['StorageClass'], 'INTELLIGENT_TIERING')

def test_operations_used_in_download_file(self):
self.parsed_responses = [
{"ContentLength": "100", "LastModified": "00:00:00Z"},
Expand Down

0 comments on commit 9686be9

Please sign in to comment.