soulsync/tests/wishlist/test_classification.py
Antti Kettunen f32fc9d56e
Extract wishlist logic into dedicated package
- add core/wishlist as the home for wishlist payload, resolution, state, processing, reporting, and selection helpers
- move wishlist-specific tests into tests/wishlist alongside the new package layout
- keep web_server.py and the import/search callers as thin adapters for now
2026-04-28 21:17:24 +03:00

19 lines
648 B
Python

import pytest
from core.wishlist.classification import classify_wishlist_track
@pytest.mark.parametrize(
"spotify_data,expected",
[
({"album": {"album_type": "single"}}, "singles"),
({"album": {"album_type": "ep"}}, "singles"),
({"album": {"album_type": "album"}}, "albums"),
({"album": {"album_type": "compilation"}}, "albums"),
({"album": {"total_tracks": 4}}, "singles"),
({"album": {"total_tracks": 8}}, "albums"),
({}, "albums"),
],
)
def test_classify_wishlist_track(spotify_data, expected):
assert classify_wishlist_track({"spotify_data": spotify_data}) == expected