Example #1
0
    def test_main(self):
        logging_str = 'neutron.agent.common.config.setup_logging'
        with mock.patch(logging_str), \
                mock.patch.object(agent.service, 'launch') as mock_launch, \
                mock.patch('sys.argv'), \
                mock.patch.object(agent.manager, 'LbaasAgentManager'), \
                mock.patch.object(cfg.CONF, 'register_opts'):
            agent.main()

            mock_launch.assert_called_once_with(mock.ANY, mock.ANY)
Example #2
0
    def test_main(self):
        logging_str = 'neutron.agent.common.config.setup_logging'
        with mock.patch(logging_str), \
                mock.patch.object(agent.service, 'launch') as mock_launch, \
                mock.patch('sys.argv'), \
                mock.patch.object(agent.manager, 'LbaasAgentManager'), \
                mock.patch.object(cfg.CONF, 'register_opts'):
            agent.main()

            mock_launch.assert_called_once_with(mock.ANY, mock.ANY)
Example #3
0
    def test_main(self):
        logging_str = 'neutron.agent.common.config.setup_logging'
        with contextlib.nested(
            mock.patch(logging_str),
            mock.patch.object(agent.service, 'launch'),
            mock.patch('sys.argv'),
            mock.patch.object(agent.manager, 'LbaasAgentManager'),
            mock.patch.object(cfg.CONF, 'register_opts')
        ) as (mock_logging, mock_launch, sys_argv, mgr_cls, ro):
            agent.main()

            mock_launch.assert_called_once_with(mock.ANY)
Example #4
0
    def test_main(self):
        logging_str = 'neutron.agent.common.config.setup_logging'
        with contextlib.nested(
            mock.patch(logging_str),
            mock.patch.object(agent.service, 'launch'),
            mock.patch('sys.argv'),
            mock.patch.object(agent.manager, 'LbaasAgentManager'),
            mock.patch.object(cfg.CONF, 'register_opts')
        ) as (mock_logging, mock_launch, sys_argv, mgr_cls, ro):
            agent.main()

            mock_launch.assert_called_once_with(mock.ANY)
Example #5
0
def main():
    agent.main()