Mock arbiter for testing.
| 66 | |
| 67 | |
| 68 | class MockArbiter: |
| 69 | """Mock arbiter for testing.""" |
| 70 | |
| 71 | def __init__(self): |
| 72 | self.cfg = MockConfig() |
| 73 | self.pid = 12345 |
| 74 | self.WORKERS = {} |
| 75 | self.LISTENERS = [] |
| 76 | self.dirty_arbiter_pid = 0 |
| 77 | self.dirty_arbiter = None |
| 78 | self.num_workers = 4 |
| 79 | self._stats = { |
| 80 | 'start_time': time.time() - 3600, # 1 hour ago |
| 81 | 'workers_spawned': 10, |
| 82 | 'workers_killed': 5, |
| 83 | 'reloads': 2, |
| 84 | } |
| 85 | |
| 86 | def wakeup(self): |
| 87 | pass |
| 88 | |
| 89 | |
| 90 | class TestShowWorkers: |
no outgoing calls