def test_launch_app_with_workers(self, mock_launch): service._launcher = None service.serve(mock.sentinel.service, workers=mock.sentinel.workers) mock_launch.assert_called_once_with(mock.ANY, mock.sentinel.service, workers=mock.sentinel.workers, restart_method='mutate')
def main(): config.parse_args(sys.argv) logging.setup(CONF, "masakari") utils.monkey_patch() objects.register_all() server = service.Service.create(binary='masakari-engine', topic=CONF.masakari_topic) service.serve(server) service.wait()
def test_launch_app_more_than_once_raises(self, mock_launch): service._launcher = None service.serve(mock.sentinel.service) self.assertRaises(RuntimeError, service.serve, mock.sentinel.service)
def test_launch_app(self, mock_launch): service._launcher = None service.serve(mock.sentinel.service) mock_launch.assert_called_once_with(mock.ANY, mock.sentinel.service, workers=None)