'If a volume is specified with a valid dataset, the cluster
configuration is updated.'

def test_dataset_updates_configuration(self):

    dataset_id = unicode(uuid4())
    d = self.assertResponseCode('POST', '/configuration/datasets', {u'dataset_id': dataset_id, u'primary': self.NODE_A}, CREATED)
    d.addCallback((lambda _: self.assertResponseCode('POST', '/configuration/containers', {u'node_uuid': self.NODE_A, u'name': u'postgres', u'image': u'postgres', u'volumes': [{u'dataset_id': dataset_id, u'mountpoint': u'/db'}]}, CREATED)))
    def check_config(_):
        config = self.persistence_service.get()
        self.assertEqual(list(config.applications())[0].volume, AttachedVolume(manifestation=Manifestation(dataset=Dataset(dataset_id=dataset_id), primary=True), mountpoint=FilePath('/db')))
    d.addCallback(check_config)
    return d
