mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-20 03:18:07 +08:00
17 lines
372 B
Python
17 lines
372 B
Python
from django_q.core import Cluster
|
|
from django_q.management.commands.qmonitor import monitor
|
|
|
|
|
|
def test_monitor():
|
|
c = Cluster()
|
|
c.start()
|
|
stats = monitor(run_once=True)
|
|
c.stop()
|
|
assert len(stats) > 0
|
|
found_c = False
|
|
for stat in stats:
|
|
if stat.cluster_id == c.pid:
|
|
found_c = True
|
|
break
|
|
assert found_c is True
|