diff --git a/neutron/tests/unit/hyperv/test_hyperv_neutron_agent.py b/neutron/tests/unit/hyperv/test_hyperv_neutron_agent.py index d8511d538a..faf1fc6fcf 100644 --- a/neutron/tests/unit/hyperv/test_hyperv_neutron_agent.py +++ b/neutron/tests/unit/hyperv/test_hyperv_neutron_agent.py @@ -111,3 +111,19 @@ class TestHyperVNeutronAgent(base.BaseTestCase): def test_treat_devices_removed_ignores_missing_port(self): self.mock_treat_devices_removed(False) + + def test_main(self): + with mock.patch.object(hyperv_neutron_agent, + 'HyperVNeutronAgent') as plugin: + with mock.patch.object(hyperv_neutron_agent, 'cfg') as cfg: + with mock.patch('eventlet.monkey_patch') as eventlet: + with mock.patch.object( + hyperv_neutron_agent, + 'logging_config') as logging_config: + + hyperv_neutron_agent.main() + + self.assertTrue(cfg.called) + self.assertTrue(eventlet.called) + self.assertTrue(logging_config.setup_logging.called) + plugin.assert_has_calls([mock.call().daemon_loop()])