feat: add real streamrip Qobuz client and opt-in live test

This commit is contained in:
Jonathan
2026-07-10 22:05:36 +02:00
parent 0091c4f5e7
commit 707038da64
3 changed files with 104 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
import os
import pytest
from lyra_worker.adapters._streamrip import StreamripClient
pytestmark = pytest.mark.skipif(
not (os.environ.get("LYRA_LIVE_TESTS") and os.environ.get("QOBUZ_EMAIL") and os.environ.get("QOBUZ_PASSWORD")),
reason="live Qobuz test; set LYRA_LIVE_TESTS=1 + QOBUZ_EMAIL + QOBUZ_PASSWORD to run",
)
def test_live_search_returns_results():
client = StreamripClient(
{"qobuz.email": os.environ["QOBUZ_EMAIL"], "qobuz.password": os.environ["QOBUZ_PASSWORD"]}
)
results = client.search_album("John Mayer", "Continuum")
assert len(results) >= 1
assert all(r["source_ref"] for r in results)
# sanity: at least one result is a plausible lossless match
assert any(r["bit_depth"] >= 16 for r in results)