Stabilize backend route tests
This commit is contained in:
@@ -1,9 +1,5 @@
|
||||
from pathlib import Path
|
||||
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
from app.main import app
|
||||
|
||||
|
||||
def test_project_var_artifact_path_is_served(tmp_path, monkeypatch):
|
||||
from app import main
|
||||
@@ -30,6 +26,7 @@ def test_project_var_artifact_path_is_served(tmp_path, monkeypatch):
|
||||
)
|
||||
monkeypatch.setattr(main, "settings", patched)
|
||||
|
||||
response = TestClient(app).get("/api/artifacts/var/uploads/datasets/case/labels/label.txt")
|
||||
assert response.status_code == 200
|
||||
assert response.text == "ok"
|
||||
response = main.api_artifact("var/uploads/datasets/case/labels/label.txt")
|
||||
|
||||
assert Path(response.path) == artifact
|
||||
assert response.media_type == "text/plain"
|
||||
|
||||
Reference in New Issue
Block a user