chore: checkpoint current backend/runtime changes
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
|
||||
from core.taskiq.app import broker, bulk_broker, critical_broker, default_broker
|
||||
|
||||
|
||||
def test_taskiq_broker_is_configured() -> None:
|
||||
assert broker is not None
|
||||
assert default_broker is broker
|
||||
assert critical_broker is not None
|
||||
assert bulk_broker is not None
|
||||
|
||||
|
||||
def test_taskiq_app_configures_logging_on_import(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
sys.modules.pop("core.taskiq.app", None)
|
||||
sys.modules.pop("core.taskiq", None)
|
||||
|
||||
called = {"count": 0, "args": None}
|
||||
|
||||
def _fake_configure_logging(*args: object, **__: object) -> None:
|
||||
called["count"] += 1
|
||||
called["args"] = args
|
||||
|
||||
monkeypatch.setattr("core.logging.configure_logging", _fake_configure_logging)
|
||||
|
||||
importlib.import_module("core.taskiq.app")
|
||||
|
||||
from core.config.settings import config
|
||||
|
||||
assert called["count"] == 1
|
||||
assert called["args"] == (config,)
|
||||
Reference in New Issue
Block a user