Files
FabledCurator/tests/test_download_source_task.py
T
2026-05-20 21:20:30 -04:00

21 lines
794 B
Python

"""Smoke test that the FC-3c Celery task is registered and routed correctly.
Mirrors test_tasks_register.py — Celery's `include=[...]` is lazy, so
the task module must be imported explicitly to trigger registration.
"""
# Side-effect import: the @celery.task decorator on download_source fires
# at module import time and registers the task with the global instance.
import backend.app.tasks.download # noqa: F401
from backend.app.celery_app import celery
def test_download_source_is_registered():
assert "backend.app.tasks.download.download_source" in celery.tasks
def test_download_source_routes_to_download_queue():
routes = celery.conf.task_routes
assert "backend.app.tasks.download.*" in routes
assert routes["backend.app.tasks.download.*"]["queue"] == "download"