'Creates a volume with metadata.'

def test_create_volume_with_metadata(self):

    metadata = {'key1': 'value1', 'key2': 'value2'}
    created_volume = self.api.post_volume({'volume': {'size': 1, 'metadata': metadata}})
    self.assertTrue(uuidutils.is_uuid_like(created_volume['id']))
    created_volume_id = created_volume['id']
    found_volume = self.api.get_volume(created_volume_id)
    self.assertEqual(created_volume_id, found_volume['id'])
    self.assertEqual(metadata, found_volume['metadata'])
