Merge "Remove unhelpful test of oslo.service ServiceLauncher"

This commit is contained in:
Jenkins 2016-05-17 14:01:18 +00:00 committed by Gerrit Code Review
commit dac04fca12

View File

@ -272,31 +272,6 @@ class TestDhcpAgent(base.BaseTestCase):
mock.call().report_state(mock.ANY, mock.ANY,
mock.ANY)])
def test_dhcp_agent_main_agent_manager(self):
logging_str = 'neutron.agent.common.config.setup_logging'
launcher_str = 'oslo_service.service.ServiceLauncher'
with mock.patch(logging_str):
with mock.patch.object(sys, 'argv') as sys_argv:
with mock.patch(launcher_str) as launcher:
sys_argv.return_value = ['dhcp', '--config-file',
base.etcdir('neutron.conf')]
entry.main()
# The signature of ServiceLauncher has changed with
# oslo.service===1.10.0, so we allow for this variant
# here, too.
# TODO(frickler): Fix this test case to not depend on
# oslo.service internals.
if launcher.mock_calls[0][2]:
launcher.assert_has_calls(
[mock.call(cfg.CONF, restart_method='reload'),
mock.call().launch_service(mock.ANY, workers=1),
mock.call().wait()])
else:
launcher.assert_has_calls(
[mock.call(cfg.CONF),
mock.call().launch_service(mock.ANY),
mock.call().wait()])
def test_run_completes_single_pass(self):
with mock.patch(DEVICE_MANAGER):
dhcp = dhcp_agent.DhcpAgent(HOSTNAME)