refactor: Web 服务器从 gunicorn 迁移到 uvicorn
This commit is contained in:
@@ -71,6 +71,22 @@ def test_build_logging_config_plain_formatter_when_disabled(tmp_path: Path) -> N
|
||||
assert handlers["error"]["formatter"] == "plain"
|
||||
|
||||
|
||||
def test_build_logging_config_resolves_default_logs_from_project_root(
|
||||
monkeypatch: pytest.MonkeyPatch,
|
||||
) -> None:
|
||||
from core.config.settings import PROJECT_ROOT
|
||||
|
||||
monkeypatch.chdir(PROJECT_ROOT / "backend")
|
||||
runtime = Settings().runtime
|
||||
config = build_logging_config(runtime)
|
||||
handlers = _get_handlers(config)
|
||||
|
||||
assert handlers["file"]["filename"] == str(PROJECT_ROOT / "logs" / "app.log")
|
||||
assert handlers["error"]["filename"] == str(
|
||||
PROJECT_ROOT / "logs" / "errors" / "app.error.log"
|
||||
)
|
||||
|
||||
|
||||
def _read_last_log_entry(log_path: Path) -> dict[str, object]:
|
||||
assert log_path.exists(), f"Expected log file at {log_path}"
|
||||
entries = [
|
||||
|
||||
Reference in New Issue
Block a user