mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-05 13:48:11 +08:00
adds --info summary to monitor command
This commit is contained in:
@@ -6,6 +6,7 @@ from django.core.management import call_command
|
||||
def test_qcluster():
|
||||
call_command('qcluster', run_once=True)
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_qmonitor():
|
||||
call_command('qmonitor', run_once=True)
|
||||
call_command('qmonitor', info=True)
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
import pytest
|
||||
import redis
|
||||
|
||||
from django_q.cluster import Cluster
|
||||
from django_q.monitor import monitor, Stat
|
||||
from django_q.monitor import monitor, Stat, info, ping_redis
|
||||
|
||||
|
||||
def test_monitor():
|
||||
@@ -17,3 +20,10 @@ def test_monitor():
|
||||
assert stat.empty_queues() is True
|
||||
break
|
||||
assert found_c is True
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_ping_redis():
|
||||
r = redis.StrictRedis(port=6388)
|
||||
with pytest.raises(Exception):
|
||||
ping_redis(r)
|
||||
|
||||
Reference in New Issue
Block a user