refactor: Web 服务器从 gunicorn 迁移到 uvicorn
This commit is contained in:
@@ -22,12 +22,18 @@ def test_taskiq_app_configures_logging_on_import(
|
||||
sys.modules.pop("core.taskiq", None)
|
||||
|
||||
called = {"count": 0, "args": None}
|
||||
banner_called = {"count": 0, "kwargs": None}
|
||||
|
||||
def _fake_configure_logging(*args: object, **__: object) -> None:
|
||||
called["count"] += 1
|
||||
called["args"] = args
|
||||
|
||||
def _fake_log_service_banner(**kwargs: object) -> None:
|
||||
banner_called["count"] += 1
|
||||
banner_called["kwargs"] = kwargs
|
||||
|
||||
monkeypatch.setattr("core.logging.configure_logging", _fake_configure_logging)
|
||||
monkeypatch.setattr("core.logging.log_service_banner", _fake_log_service_banner)
|
||||
|
||||
importlib.import_module("core.taskiq.app")
|
||||
|
||||
@@ -35,3 +41,8 @@ def test_taskiq_app_configures_logging_on_import(
|
||||
|
||||
assert called["count"] == 1
|
||||
assert called["args"] == (config,)
|
||||
assert banner_called["count"] == 1
|
||||
assert banner_called["kwargs"] == {
|
||||
"service_name": config.runtime.service_name,
|
||||
"environment": config.runtime.environment,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user