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

Method create_worker

tests/test_gtornado.py:54–70  ·  tests/test_gtornado.py::TestTornadoWorkerInit.create_worker

Create a worker instance for testing.

(self, cfg=None)

Source from the content-addressed store, hash-verified

52 class="st">""class="st">"Tests for TornadoWorker initialization."class="st">""
53
54 def create_worker(self, cfg=None):
55 class="st">""class="st">"Create a worker instance for testing."class="st">""
56 if cfg is None:
57 cfg = Config()
58 cfg.set(&class="cm">#x27;workers', 1)
59 cfg.set(&class="cm">#x27;max_requests', 0)
60
61 worker = gtornado.TornadoWorker(
62 age=1,
63 ppid=os.getpid(),
64 sockets=[],
65 app=mock.Mock(),
66 timeout=30,
67 cfg=cfg,
68 log=mock.Mock(),
69 )
70 return worker
71
72 def test_worker_init(self):
73 class="st">""class="st">"Test worker initialization."class="st">""

Callers 2

test_worker_initMethod · 0.95

Calls 2

setMethod · 0.95
ConfigClass · 0.90

Tested by

no test coverage detected