Files
streamrip-ui/backend/tests/test_health.py
T
loki 008c713840
CI / backend-tests (push) Successful in 11s
Docker images / backend (push) Successful in 8s
Docker images / frontend (push) Successful in 25s
CI / docker (push) Successful in 3s
feat: commit-hash in UI + korb vor downloads
2026-10-04 14:55:02 +02:00

28 lines
735 B
Python

from fastapi.testclient import TestClient
from app.main import app
def test_health():
c = TestClient(app)
r = c.get("/api/health")
assert r.status_code == 200
assert r.json()["status"] == "ok"
def test_sources_deezer_only():
c = TestClient(app)
r = c.get("/api/sources")
assert r.status_code == 200
assert r.json()["sources"] == ["deezer"]
def test_version_endpoint(monkeypatch):
from app.core import settings
monkeypatch.setattr(settings, "APP_VERSION", "2026.10.04.7")
monkeypatch.setattr(settings, "APP_COMMIT", "abc1234")
c = TestClient(app)
r = c.get("/api/version")
assert r.status_code == 200
assert r.json() == {"version": "2026.10.04.7", "commit": "abc1234"}