Пример #1
0
 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')
Пример #2
0
 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')
Пример #3
0
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()
Пример #4
0
 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)
Пример #5
0
 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)
Пример #6
0
 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)
Пример #7
0
 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)