mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-06 07:08:11 +08:00
fixing django settings for travis
This commit is contained in:
+5
-2
@@ -1,5 +1,8 @@
|
|||||||
language: python
|
language: python
|
||||||
|
|
||||||
|
services:
|
||||||
|
- redis-server
|
||||||
|
|
||||||
python:
|
python:
|
||||||
- "2.7"
|
- "2.7"
|
||||||
- "3.4"
|
- "3.4"
|
||||||
@@ -10,11 +13,11 @@ env:
|
|||||||
|
|
||||||
install:
|
install:
|
||||||
- pip install -q django==$DJANGO --use-mirrors
|
- pip install -q django==$DJANGO --use-mirrors
|
||||||
- pip install redis coveralls coloredlogs hiredis jsonpickle simplejson
|
- pip install redis coveralls coloredlogs hiredis jsonpickle simplejson --use-mirrors
|
||||||
- python setup.py install
|
- python setup.py install
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- coverage run --source=django_q setup.py test
|
- coverage run setup.py test
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- coveralls
|
- coveralls
|
||||||
|
|||||||
@@ -1,33 +0,0 @@
|
|||||||
import sys
|
|
||||||
import os
|
|
||||||
from time import sleep
|
|
||||||
from multiprocessing import Event
|
|
||||||
|
|
||||||
myPath = os.path.dirname(os.path.abspath(__file__))
|
|
||||||
sys.path.insert(0, myPath + '/../')
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
from django_q import Cluster
|
|
||||||
from django_q.main import Sentinel
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope='session')
|
|
||||||
def cluster():
|
|
||||||
return Cluster()
|
|
||||||
|
|
||||||
|
|
||||||
def test_cluster_initial(cluster):
|
|
||||||
assert cluster.sentinel is None
|
|
||||||
cluster.start()
|
|
||||||
assert cluster.sentinel.is_alive() is True
|
|
||||||
cluster.stop()
|
|
||||||
sleep(2)
|
|
||||||
assert cluster.sentinel.is_alive() is False
|
|
||||||
|
|
||||||
def test_sentinel():
|
|
||||||
event = Event()
|
|
||||||
sentinel = Sentinel(event)
|
|
||||||
sleep(1)
|
|
||||||
assert sentinel.monitor_pid > 0
|
|
||||||
assert sentinel.pusher_pid > 0
|
|
||||||
assert len(sentinel.pool) == sentinel.pool_size + 2
|
|
||||||
+3
-5
@@ -1,11 +1,9 @@
|
|||||||
blessed
|
blessed==1.9.5
|
||||||
future
|
|
||||||
-e .
|
|
||||||
coloredlogs==1.0.1
|
coloredlogs==1.0.1
|
||||||
django-picklefield==0.3.1
|
django-picklefield==0.3.1
|
||||||
Django==1.8.2
|
Django==1.8.2
|
||||||
|
future==0.14.3
|
||||||
hiredis==0.2.0
|
hiredis==0.2.0
|
||||||
humanfriendly==1.27
|
|
||||||
jsonpickle==0.9.2
|
jsonpickle==0.9.2
|
||||||
logutils==0.3.3
|
|
||||||
redis==2.10.3
|
redis==2.10.3
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user