def copy(self): """ Copies a object in s3 to another location in s3. """ copy_source = self.src bucket, key = find_bucket_key(self.dest) params = {'Bucket': bucket, 'CopySource': copy_source, 'Key': key} self._inject_content_type(params) RequestParamsMapper.map_copy_object_params(params, self.parameters) response_data = self.client.copy_object(**params)
def test_copy_object(self): params = {} RequestParamsMapper.map_copy_object_params(params, self.cli_params) self.assertEqual( params, { 'CopySourceSSECustomerAlgorithm': 'AES256', 'CopySourceSSECustomerKey': 'my-sse-c-copy-source-key', 'SSECustomerAlgorithm': 'AES256', 'SSECustomerKey': 'my-sse-c-key', 'SSEKMSKeyId': 'my-kms-key', 'ServerSideEncryption': 'AES256' })
def test_copy_object(self): params = {} RequestParamsMapper.map_copy_object_params(params, self.cli_params) self.assertEqual( params, {'CopySourceSSECustomerAlgorithm': 'AES256', 'CopySourceSSECustomerKey': 'my-sse-c-copy-source-key', 'SSECustomerAlgorithm': 'AES256', 'SSECustomerKey': 'my-sse-c-key', 'SSEKMSKeyId': 'my-kms-key', 'ServerSideEncryption': 'AES256'} )
def test_copy_object(self): params = {} RequestParamsMapper.map_copy_object_params(params, self.cli_params) self.assertEqual( params, { "CopySourceSSECustomerAlgorithm": "AES256", "CopySourceSSECustomerKey": "my-sse-c-copy-source-key", "SSECustomerAlgorithm": "AES256", "SSECustomerKey": "my-sse-c-key", "SSEKMSKeyId": "my-kms-key", "ServerSideEncryption": "AES256", }, )
def test_copy_object(self): params = {} RequestParamsMapper.map_copy_object_params(params, self.cli_params) self.assertEqual(params, {'RequestPayer': 'requester'})