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

Method create_worker

tests/test_gtornado.py:226–240  ·  view source on GitHub ↗

Create a worker for testing.

(self)

Source from the content-addressed store, hash-verified

224 """Tests for heartbeat functionality."""
225
226 def create_worker(self):
227 """Create a worker for testing."""
228 cfg = Config()
229 cfg.set('workers', 1)
230
231 worker = gtornado.TornadoWorker(
232 age=1,
233 ppid=os.getpid(),
234 sockets=[],
235 app=mock.Mock(),
236 timeout=30,
237 cfg=cfg,
238 log=mock.Mock(),
239 )
240 return worker
241
242 def test_heartbeat_stops_server_when_not_alive(self):
243 """Test that heartbeat stops the server when not alive."""

Calls 2

setMethod · 0.95
ConfigClass · 0.90

Tested by

no test coverage detected