'Calling the ``/VolumerDriver.Create`` API with an ``Opts`` value
of "profile=[gold,silver,bronze] in the request body JSON create a
volume with a given name with [gold,silver,bronze] profile.'

def test_create_with_profile(self):

    profile = sampled_from(['gold', 'silver', 'bronze']).example()
    name = random_name(self)
    d = self.assertResult('POST', '/VolumeDriver.Create', {u'Name': name, 'Opts': {u'profile': profile}}, OK, {u'Err': u''})
    d.addCallback((lambda _: self.flocker_client.list_datasets_configuration()))
    d.addCallback(list)
    d.addCallback((lambda result: self.assertItemsEqual(result, [Dataset(dataset_id=result[0].dataset_id, primary=self.NODE_A, maximum_size=int(DEFAULT_SIZE.to_Byte()), metadata={NAME_FIELD: name, u'clusterhq:flocker:profile': unicode(profile)})])))
    return d
