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

Method test_show_stats

tests/ctl/test_handlers.py:133–151  ·  view source on GitHub ↗

Test showing stats.

(self)

Source from the content-addressed store, hash-verified

131 """Tests for show stats command."""
132
133 def test_show_stats(self):
134 """Test showing stats."""
135 arbiter = MockArbiter()
136 arbiter.WORKERS = {
137 1001: MockWorker(1001, 1),
138 1002: MockWorker(1002, 2),
139 }
140 handlers = CommandHandlers(arbiter)
141
142 result = handlers.show_stats()
143
144 assert result["pid"] == 12345
145 assert result["workers_current"] == 2
146 assert result["workers_target"] == 4
147 assert result["workers_spawned"] == 10
148 assert result["workers_killed"] == 5
149 assert result["reloads"] == 2
150 assert result["uptime"] is not None
151 assert result["uptime"] > 0
152
153
154class TestShowConfig:

Callers

nothing calls this directly

Calls 4

show_statsMethod · 0.95
CommandHandlersClass · 0.90
MockArbiterClass · 0.70
MockWorkerClass · 0.70

Tested by

no test coverage detected