Create a worker instance for testing.
(self, cfg=None)
| 90 | """Tests for request counting and max_requests behavior.""" |
| 91 | |
| 92 | def create_worker(self, cfg=None): |
| 93 | """Create a worker instance for testing.""" |
| 94 | if cfg is None: |
| 95 | cfg = Config() |
| 96 | cfg.set('workers', 1) |
| 97 | |
| 98 | worker = gtornado.TornadoWorker( |
| 99 | age=1, |
| 100 | ppid=os.getpid(), |
| 101 | sockets=[], |
| 102 | app=mock.Mock(), |
| 103 | timeout=30, |
| 104 | cfg=cfg, |
| 105 | log=mock.Mock(), |
| 106 | ) |
| 107 | return worker |
| 108 | |
| 109 | def test_handle_request_increments_counter(self): |
| 110 | """Test that handle_request increments the request counter.""" |
no test coverage detected