def test_arbiter_shutdown_closes_listeners(): arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) listener1 = mock.Mock() listener2 = mock.Mock() arbiter.LISTENERS = [listener1, listener2] arbiter.stop() listener1.close.assert_called_with() listener2.close.assert_called_with()
def test_arbiter_stop_closes_listeners(close_sockets): arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) listener1 = mock.Mock() listener2 = mock.Mock() listeners = [listener1, listener2] arbiter.LISTENERS = listeners arbiter.stop() close_sockets.assert_called_with(listeners, True)
def test_arbiter_stop_closes_listeners(close_sockets): arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) listener1 = mock.Mock() listener2 = mock.Mock() listeners = [listener1, listener2] arbiter.LISTENERS = listeners arbiter.stop() close_sockets.assert_called_with(listeners, True)
def test_arbiter_shutdown_closes_listeners(): arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) listener1 = mock.Mock() listener2 = mock.Mock() arbiter.LISTENERS = [listener1, listener2] arbiter.stop() listener1.close.assert_called_with(False) listener2.close.assert_called_with(False)
def test_arbiter_stop_does_not_unlink_when_using_reuse_port(close_sockets): arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) arbiter.cfg.settings['reuse_port'] = ReusePort() arbiter.cfg.settings['reuse_port'].set(True) arbiter.stop() close_sockets.assert_called_with([], False)
def test_arbiter_stop_does_not_unlink_systemd_listeners(close_sockets): arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) arbiter.systemd = True arbiter.stop() close_sockets.assert_called_with([], False)
def test_arbiter_stop_parent_does_not_unlink_listeners(close_sockets): arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) arbiter.master_pid = os.getppid() arbiter.stop() close_sockets.assert_called_with([], False)
def test_arbiter_stop_does_not_unlink_when_using_reuse_port(close_sockets): arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) arbiter.cfg.settings['reuse_port'] = ReusePort() arbiter.cfg.settings['reuse_port'].set(True) arbiter.stop() close_sockets.assert_called_with([], False)
def test_arbiter_stop_does_not_unlink_systemd_listeners(close_sockets): arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) arbiter.systemd = True arbiter.stop() close_sockets.assert_called_with([], False)
def test_arbiter_stop_parent_does_not_unlink_listeners(close_sockets): arbiter = gunicorn.arbiter.Arbiter(DummyApplication()) arbiter.master_pid = os.getppid() arbiter.stop() close_sockets.assert_called_with([], False)