def test_s3_put_presigned_url_metadata(self):
    bucket_name = ('test-bucket-%s' % short_uid())
    client = self._get_test_client()
    client.create_bucket(Bucket=bucket_name)
    metadata = {'foo': 'bar'}
    object_key = 'key-by-hostname'
    url = client.generate_presigned_url('put_object', Params={'Bucket': bucket_name, 'Key': object_key, 'Metadata': metadata})
    response = requests.put(url, data='content 123', verify=False)
    self.assertLess(response.status_code, 400)
    self.assertEqual('', to_str(response.content))
    response = client.head_object(Bucket=bucket_name, Key=object_key)
    self.assertEquals('bar', response.get('Metadata', {}).get('foo'))
    self._delete_bucket(bucket_name, [object_key])
def test_s3_put_presigned_url_metadata(self):
    bucket_name = ('test-bucket-%s' % short_uid())
    client = self._get_test_client()
    client.create_bucket(Bucket=bucket_name)
    metadata = {'foo': 'bar'}
    object_key = 'key-by-hostname'
    url = client.generate_presigned_url('put_object', Params={'Bucket': bucket_name, 'Key': object_key, 'Metadata': metadata})
    response = requests.put(url, data='content 123', verify=False)
    self.assertLess(response.status_code, 400)
    self.assertEqual(, to_str(response.content))
    response = client.head_object(Bucket=bucket_name, Key=object_key)
    self.assertEquals('bar', response.get('Metadata', {}).get('foo'))
    self._delete_bucket(bucket_name, [object_key])