This commit is contained in:
Gilles Soulier
2026-01-14 21:54:55 +01:00
parent c91c0f1fc9
commit d0b73b9319
140 changed files with 5822 additions and 161 deletions

View File

@@ -0,0 +1,16 @@
"""
Tests API logs Uvicorn.
"""
from pricewatch.app.api.main import list_uvicorn_logs
def test_list_uvicorn_logs_reads_file(monkeypatch, tmp_path):
log_file = tmp_path / "uvicorn.log"
log_file.write_text("ligne-1\nligne-2\n", encoding="utf-8")
monkeypatch.setattr("pricewatch.app.api.main.UVICORN_LOG_PATH", log_file)
response = list_uvicorn_logs(limit=1)
assert len(response) == 1
assert response[0].line == "ligne-2"