- 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
19 lines
648 B
Python
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
|