Stabilize backend route tests
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
from pathlib import Path
|
||||
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from app import main
|
||||
from app.main import app
|
||||
from app.modules.results.service import parse_training_curve
|
||||
|
||||
|
||||
@@ -39,9 +36,9 @@ def test_results_api_honors_limit(monkeypatch):
|
||||
return [{"name": "a.png", "relative_path": "var/a.png"}]
|
||||
|
||||
monkeypatch.setattr(main, "scan_results", fake_scan_results)
|
||||
response = TestClient(app).get("/api/results?limit=123")
|
||||
response = main.api_results(limit=123)
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response == [{"name": "a.png", "relative_path": "var/a.png"}]
|
||||
assert calls["limit"] == 123
|
||||
|
||||
|
||||
@@ -53,7 +50,7 @@ def test_results_curve_api_honors_limit(monkeypatch):
|
||||
return [{"name": "results", "relative_path": "var/results.csv"}]
|
||||
|
||||
monkeypatch.setattr(main, "scan_training_curves", fake_scan_training_curves)
|
||||
response = TestClient(app).get("/api/results/curves?limit=77")
|
||||
response = main.api_result_curves(limit=77)
|
||||
|
||||
assert response.status_code == 200
|
||||
assert response == [{"name": "results", "relative_path": "var/results.csv"}]
|
||||
assert calls["limit"] == 77
|
||||
|
||||
Reference in New Issue
Block a user