feat: add real streamrip Qobuz client and opt-in live test
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user