mirror of https://github.com/Nezreka/SoulSync.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
896 B
24 lines
896 B
import pytest
|
|
|
|
from core.wishlist.classification import classify_wishlist_track
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
"spotify_data,expected",
|
|
[
|
|
({"album": {"album_type": "single"}}, "singles"),
|
|
({"track_data": {"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"),
|
|
({"album": {"total_tracks": "4"}}, "singles"),
|
|
({"album": {"total_tracks": "8"}}, "albums"),
|
|
({"album": {"total_tracks": "not-a-number"}}, "albums"),
|
|
({}, "albums"),
|
|
],
|
|
)
|
|
def test_classify_wishlist_track(spotify_data, expected):
|
|
assert classify_wishlist_track({"spotify_data": spotify_data}) == expected
|