Create a worker instance for testing.
(self, cfg=None)
| 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">"" |
no test coverage detected