From 7a5beadd17fe00b9105b58b81e55e92c41a64a8e Mon Sep 17 00:00:00 2001 From: Paul Lamere Date: Wed, 30 Mar 2016 15:41:22 -0400 Subject: [PATCH] Added artist_recommendations example fixed recs test --- tests/authtests2.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/authtests2.py b/tests/authtests2.py index 8bf513f..f0ebcd7 100644 --- a/tests/authtests2.py +++ b/tests/authtests2.py @@ -46,15 +46,16 @@ class AuthTestSpotipy(unittest.TestCase): def test_audio_features_with_bad_track(self): bad_tracks = [] bad_tracks = ['spotify:track:bad'] - input = bad_tracks + self.four_tracks + bad_tracks + input = self.four_tracks + bad_tracks results = spotify.audio_features(input) self.assertTrue(len(results) == len(input)) for track in results[:-1]: - assert('speechiness' in track) + if track != None: + assert('speechiness' in track) self.assertTrue(results[-1] == None) def test_recommendations(self): - results = spotify.recommendations(self.four_tracks, min_danceability=0, max_loudness=0, target_popularity=50) + results = spotify.recommendations(seed_tracks=self.four_tracks, min_danceability=0, max_loudness=0, target_popularity=50) self.assertTrue(len(results['tracks']) == 20)