def test__get_upload_arguments(self):
    name = u'blob-name'
    key = b'[pXw@,p@@AfBfrR3x-2b2SCHR,.?YwRO'
    blob = self._make_one(name, bucket=None, encryption_key=key)
    blob.content_disposition = 'inline'
    content_type = u'image/jpeg'
    info = blob._get_upload_arguments(content_type)
    (headers, object_metadata, new_content_type) = info
    header_key_value = 'EXAMPLE_KEY'
    header_key_hash_value = 'EXAMPLE_KEY'
    expected_headers = {'X-Goog-Encryption-Algorithm': 'AES256', 'X-Goog-Encryption-Key': header_key_value, 'X-Goog-Encryption-Key-Sha256': header_key_hash_value}
    self.assertEqual(headers, expected_headers)
    expected_metadata = {'contentDisposition': blob.content_disposition, 'name': name}
    self.assertEqual(object_metadata, expected_metadata)
    self.assertEqual(new_content_type, content_type)
def test__get_upload_arguments(self):
    name = u'blob-name'
    key = b'[pXw@,p@@AfBfrR3x-2b2SCHR,.?YwRO'
    blob = self._make_one(name, bucket=None, encryption_key=key)
    blob.content_disposition = 'inline'
    content_type = u'image/jpeg'
    info = blob._get_upload_arguments(content_type)
    (headers, object_metadata, new_content_type) = info
    header_key_value = 'EXAMPLE_KEY'
    header_key_hash_value = 'EXAMPLE_KEY'
    expected_headers = {'X-Goog-Encryption-Algorithm': 'AES256', 'X-Goog-Encryption-Key': header_key_value, 'X-Goog-Encryption-Key-Sha256': header_key_hash_value}
    self.assertEqual(headers, expected_headers)
    expected_metadata = {'contentDisposition': blob.content_disposition, 'name': name}
    self.assertEqual(object_metadata, expected_metadata)
    self.assertEqual(new_content_type, content_type)