From 5d34eda4b902aca7024ec5b6eb91a30447c8f6ad Mon Sep 17 00:00:00 2001 From: draco Date: Tue, 26 Dec 2023 23:26:13 +0100 Subject: [PATCH] correct imports, new embed cover path, passes Qobuz client and fixture had to be imported The embedded cover is saved somewhere else now. Uses the path from the object itself to check if it gets downloaded, unsure if this is static or dynamic. --- tests/fixtures/clients.py | 2 +- tests/test_track.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/fixtures/clients.py b/tests/fixtures/clients.py index b604fee..6dd4d6d 100644 --- a/tests/fixtures/clients.py +++ b/tests/fixtures/clients.py @@ -5,7 +5,7 @@ import pytest from util import arun from streamrip.config import Config -from streamrip.qobuz_client import QobuzClient +from streamrip.client.qobuz import QobuzClient @pytest.fixture(scope="session") diff --git a/tests/test_track.py b/tests/test_track.py index d11b164..159c99b 100644 --- a/tests/test_track.py +++ b/tests/test_track.py @@ -7,16 +7,20 @@ from streamrip.client.downloadable import Downloadable from streamrip.client.qobuz import QobuzClient from streamrip.media.track import PendingSingle, Track import streamrip.db as db +from fixtures.clients import qobuz_client def test_pending_resolve(qobuz_client: QobuzClient): qobuz_client.config.session.downloads.folder = "./tests" p = PendingSingle("19512574", qobuz_client, qobuz_client.config, db.Database(db.Dummy(), db.Dummy())) t = arun(p.resolve()) - dir = "tests/Fleetwood Mac - Rumours (1977) [FLAC] [24B-96kHz]" + dir = "tests/tests/Fleetwood Mac - Rumours (1977) [FLAC] [24B-96kHz]" assert os.path.isdir(dir) assert os.path.isfile(os.path.join(dir, "cover.jpg")) - assert os.path.isfile(os.path.join(dir, "embed_cover.jpg")) + #embedded_cover_path aka t.cover_path is + #./tests/./tests/Fleetwood Mac - Rumours (1977) [FLAC] [24B-96kHz]/ + # __artwork/cover-9202762427033526105.jpg + assert os.path.isfile(t.cover_path) assert isinstance(t, Track) assert isinstance(t.downloadable, Downloadable) assert t.cover_path is not None