| 1 |
from pytest_celery import CeleryTestSetup |
| 2 |
|
| 3 |
|
| 4 |
class test_control: |
| 5 |
def test_sanity(self, celery_setup: CeleryTestSetup): |
| 6 |
r = celery_setup.app.control.ping() |
| 7 |
assert all( |
| 8 |
[ |
| 9 |
all([res["ok"] == "pong" for _, res in response.items()]) |
| 10 |
for response in r |
| 11 |
] |
| 12 |
) |
| 13 |
|
| 14 |
def test_shutdown_exit_with_zero(self, celery_setup: CeleryTestSetup): |
| 15 |
celery_setup.app.control.shutdown(destination=[celery_setup.worker.hostname()]) |
| 16 |
while celery_setup.worker.container.status != "exited": |
| 17 |
celery_setup.worker.container.reload() |
| 18 |
assert celery_setup.worker.container.attrs["State"]["ExitCode"] == 0 |