MCPcopy
hub / github.com/benoitc/gunicorn / test_shutdown_graceful

Method test_shutdown_graceful

tests/ctl/test_handlers.py:386–396  ·  view source on GitHub ↗

Test graceful shutdown.

(self)

Source from the content-addressed store, hash-verified

384 """Tests for shutdown command."""
385
386 def test_shutdown_graceful(self):
387 """Test graceful shutdown."""
388 arbiter = MockArbiter()
389 handlers = CommandHandlers(arbiter)
390
391 with patch('os.kill') as mock_kill:
392 result = handlers.shutdown()
393
394 assert result["status"] == "shutting_down"
395 assert result["mode"] == "graceful"
396 mock_kill.assert_called_once_with(12345, signal.SIGTERM)
397
398 def test_shutdown_quick(self):
399 """Test quick shutdown."""

Callers

nothing calls this directly

Calls 3

shutdownMethod · 0.95
CommandHandlersClass · 0.90
MockArbiterClass · 0.70

Tested by

no test coverage detected