mirror of
https://github.com/django-q2/django-q2.git
synced 2026-09-30 22:08:12 +08:00
23 lines
432 B
Python
23 lines
432 B
Python
import sys
|
|
import os
|
|
from time import sleep
|
|
|
|
myPath = os.path.dirname(os.path.abspath(__file__))
|
|
sys.path.insert(0, myPath + '/../')
|
|
|
|
import pytest
|
|
from django_q import Cluster
|
|
|
|
|
|
@pytest.fixture(scope='session')
|
|
def cluster():
|
|
return Cluster()
|
|
|
|
|
|
def test_cluster_initial(cluster):
|
|
cluster.start()
|
|
assert cluster.sentinel.is_alive() is True
|
|
cluster.stop()
|
|
sleep(2)
|
|
assert cluster.sentinel.is_alive() is False
|