Exemple #1
0
 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)
Exemple #2
0
 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'
         })
Exemple #4
0
 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'}
     )
Exemple #5
0
 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'})
Exemple #7
0
 def test_copy_object(self):
     params = {}
     RequestParamsMapper.map_copy_object_params(params, self.cli_params)
     self.assertEqual(params, {'RequestPayer': 'requester'})