'Test for bug 1316532.'

def test_when_keystone_fail(self):

    self.useFixture(fixtures.MockPatch('keystoneclient.v2_0.client.Client', side_effect=ka_exceptions.ClientException))
    self.pipeline_cfg = {'sources': [{'name': 'test_keystone', 'interval': 10, 'meters': ['testkeystone'], 'resources': ['test://'], 'sinks': ['test_sink']}], 'sinks': [{'name': 'test_sink', 'transformers': [], 'publishers': ['test']}]}
    self.mgr.polling_manager = pipeline.PollingManager(self.CONF, self.cfg2file(self.pipeline_cfg))
    polling_tasks = self.mgr.setup_polling_tasks()
    self.mgr.interval_task(list(polling_tasks.values())[0])
    self.assertFalse(self.PollsterKeystone.samples)
    self.assertFalse(self.notified_samples)
