Create a worker for testing.
(self, **kwargs)
| 130 | """Tests for ASGIWorker initialization.""" |
| 131 | |
| 132 | def create_worker(self, **kwargs): |
| 133 | """Create a worker for testing.""" |
| 134 | cfg = Config() |
| 135 | cfg.set('workers', 1) |
| 136 | cfg.set('worker_connections', 1000) |
| 137 | |
| 138 | for key, value in kwargs.items(): |
| 139 | cfg.set(key, value) |
| 140 | |
| 141 | worker = gasgi.ASGIWorker( |
| 142 | age=1, |
| 143 | ppid=os.getpid(), |
| 144 | sockets=[], |
| 145 | app=FakeApp(), |
| 146 | timeout=30, |
| 147 | cfg=cfg, |
| 148 | log=mock.Mock(), |
| 149 | ) |
| 150 | return worker |
| 151 | |
| 152 | def test_worker_init(self): |
| 153 | """Test worker initialization.""" |
no test coverage detected