コード例 #1
0
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()
コード例 #2
0
ファイル: test_arbiter.py プロジェクト: ifduyue/gunicorn
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)
コード例 #3
0
ファイル: test_arbiter.py プロジェクト: yzfedora/gunicorn
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)
コード例 #4
0
ファイル: test_arbiter.py プロジェクト: MPOWER4RU/gunicorn
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)
コード例 #5
0
ファイル: test_arbiter.py プロジェクト: ifduyue/gunicorn
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)
コード例 #6
0
ファイル: test_arbiter.py プロジェクト: ifduyue/gunicorn
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)
コード例 #7
0
ファイル: test_arbiter.py プロジェクト: ifduyue/gunicorn
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)
コード例 #8
0
ファイル: test_arbiter.py プロジェクト: yzfedora/gunicorn
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)
コード例 #9
0
ファイル: test_arbiter.py プロジェクト: yzfedora/gunicorn
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)
コード例 #10
0
ファイル: test_arbiter.py プロジェクト: yzfedora/gunicorn
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)