From 267c48962ed0e7a9990242d59668394b729c6129 Mon Sep 17 00:00:00 2001 From: draco Date: Tue, 26 Dec 2023 23:55:30 +0100 Subject: [PATCH] fix import, argument order, afor->arun, album ID The album ID was the ID of the artist, not the album. Fixed now. The tests in this file now pass. --- tests/test_qobuz_client.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/test_qobuz_client.py b/tests/test_qobuz_client.py index efed40a..b444ce6 100644 --- a/tests/test_qobuz_client.py +++ b/tests/test_qobuz_client.py @@ -7,6 +7,8 @@ from streamrip.config import Config from streamrip.client.downloadable import BasicDownloadable from streamrip.exceptions import MissingCredentialsError from streamrip.client.qobuz import QobuzClient +from fixtures.clients import qobuz_client + logger = logging.getLogger("streamrip") @@ -23,7 +25,7 @@ def test_client_raises_missing_credentials(): def test_client_get_metadata(client): - meta = arun(client.get_metadata("lzpf67e8f4h1a", "album")) + meta = arun(client.get_metadata("s9nzkwg2rh1nc", "album")) assert meta["title"] == "I Killed Your Dog" assert len(meta["tracks"]["items"]) == 16 assert meta["maximum_bit_depth"] == 24 @@ -38,18 +40,19 @@ def test_client_get_downloadable(client): def test_client_search_limit(client): - res = client.search("rumours", "album", limit=5) + res = client.search("album", "rumours", limit=5) total = 0 - for r in afor(res): + for r in arun(res): total += len(r["albums"]["items"]) assert total == 5 def test_client_search_no_limit(client): - res = client.search("rumours", "album", limit=None) + # Setting no limit has become impossible because `limit: int` now + res = client.search("album", "rumours", limit=10000) correct_total = 0 total = 0 - for r in afor(res): + for r in arun(res): total += len(r["albums"]["items"]) correct_total = max(correct_total, r["albums"]["total"]) assert total == correct_total