diff --git a/tests/agentbase.py b/tests/agentbase.py index 9deba23be..383b8e70d 100644 --- a/tests/agentbase.py +++ b/tests/agentbase.py @@ -28,6 +28,7 @@ from stevedore.tests import manager as extension_tests from ceilometer import sample from ceilometer import pipeline +from ceilometer import agent from ceilometer.tests import base from ceilometer import transformer @@ -246,6 +247,13 @@ class BaseAgentManagerTestCase(base.TestCase): pub = self.mgr.pipeline_manager.pipelines[0].publishers[0] self.assertEqual(len(pub.samples), 0) + def test_agent_manager_initialize_service_hook(self): + mgr = agent.AgentManager(self.mgr.pollster_manager) + mgr.create_polling_task = mock.MagicMock() + service = mock.MagicMock() + mgr.initialize_service_hook(service) + self.assertTrue(service.tg.add_timer.called) + def test_manager_exception_persistency(self): self.pipeline_cfg.append({ 'name': "test_pipeline",