def test_playlist_tracks_conntent(app, playlist_item, response_playlist_tracks): playlist = qobuz.Playlist(playlist_item) tracks = playlist.get_tracks() track_items = playlist_get_tracks_json["tracks"]["items"] assert tracks[0].id == track_items[0]["id"] assert tracks[0].title == track_items[0]["title"] assert tracks[0].album == qobuz.Album(track_items[0]["album"]) assert tracks[1].id == track_items[1]["id"] assert tracks[1].title == track_items[1]["title"] assert tracks[1].album == qobuz.Album(track_items[1]["album"])
def test_playlist_tracks_type(app, playlist_item, response_playlist_tracks): playlist = qobuz.Playlist(playlist_item) for t in playlist.get_tracks(): assert isinstance(t, qobuz.Track)
def test_playlist_init(app): playlist = qobuz.Playlist(playlist_create_json) assert playlist.id == playlist_create_json["id"] assert playlist.name == playlist_create_json["name"] assert playlist.description == playlist_create_json["description"]
def test_playlist_tracks_len(app, playlist_item, response_playlist_tracks): playlist = qobuz.Playlist(playlist_item) assert len(playlist.get_tracks()) == 2
def playlist(): return qobuz.Playlist(playlist_create_json)