예제 #1
0
파일: test_config.py 프로젝트: lkolacek/iib
def test_configure_celery_with_classes_and_files(mock_open, mock_isfile, mock_getenv):
    mock_getenv.return_value = ''
    mock_open.return_value = BytesIO(
        b'task_default_queue = "not-iib"\ntimezone="America/New_York"\n'
    )
    celery_app = celery.Celery()
    assert celery_app.conf.task_default_queue == 'celery'
    assert celery_app.conf.timezone is None
    configure_celery(celery_app)
    assert celery_app.conf.task_default_queue == 'not-iib'
    assert celery_app.conf.timezone == 'America/New_York'
예제 #2
0
def test_configure_celery_with_classes(mock_isfile):
    celery_app = celery.Celery()
    assert celery_app.conf.task_default_queue == 'celery'
    configure_celery(celery_app)
    assert celery_app.conf.task_default_queue == 'iib'
    assert celery_app.conf.broker_connection_max_retries == 10
예제 #3
0
파일: test_config.py 프로젝트: lkolacek/iib
def test_configure_celery_with_classes(mock_isfile):
    celery_app = celery.Celery()
    assert celery_app.conf.task_default_queue == 'celery'
    configure_celery(celery_app)
    assert celery_app.conf.task_default_queue == 'iib'
예제 #4
0
파일: celery.py 프로젝트: zxiong/iib
# SPDX-License-Identifier: GPL-3.0-or-later
import celery
from celery.signals import celeryd_init

from iib.workers.config import configure_celery, validate_celery_config

app = celery.Celery()
configure_celery(app)
celeryd_init.connect(validate_celery_config)