28 lines
735 B
Python
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"}
|