mirror of
https://github.com/c0de-archive/spotipy.git
synced 2024-11-05 07:27:47 +00:00
Expanded 404 test
This commit is contained in:
parent
d5fb9f2f89
commit
eecff1fce7
@ -12,6 +12,7 @@ class TestSpotipy(unittest.TestCase):
|
|||||||
creep_id = '3HfB5hBU0dmBt8T0iCmH42'
|
creep_id = '3HfB5hBU0dmBt8T0iCmH42'
|
||||||
creep_url = 'http://open.spotify.com/track/3HfB5hBU0dmBt8T0iCmH42'
|
creep_url = 'http://open.spotify.com/track/3HfB5hBU0dmBt8T0iCmH42'
|
||||||
el_scorcho_urn = 'spotify:track:0Svkvt5I79wficMFgaqEQJ'
|
el_scorcho_urn = 'spotify:track:0Svkvt5I79wficMFgaqEQJ'
|
||||||
|
el_scorcho_bad_urn = 'spotify:track:0Svkvt5I79wficMFgaqEQK'
|
||||||
pinkerton_urn = 'spotify:album:04xe676vyiTeYNXw15o9jT'
|
pinkerton_urn = 'spotify:album:04xe676vyiTeYNXw15o9jT'
|
||||||
weezer_urn = 'spotify:artist:3jOstUTkEu2JkjvRdBA5Gu'
|
weezer_urn = 'spotify:artist:3jOstUTkEu2JkjvRdBA5Gu'
|
||||||
pablo_honey_urn = 'spotify:album:6AZv3m27uyRxi8KyJSfUxL'
|
pablo_honey_urn = 'spotify:album:6AZv3m27uyRxi8KyJSfUxL'
|
||||||
@ -69,6 +70,13 @@ class TestSpotipy(unittest.TestCase):
|
|||||||
track = self.spotify.track(self.creep_url)
|
track = self.spotify.track(self.creep_url)
|
||||||
self.assertTrue(track['name'] == 'Creep')
|
self.assertTrue(track['name'] == 'Creep')
|
||||||
|
|
||||||
|
def test_track_bad_urn(self):
|
||||||
|
try:
|
||||||
|
track = self.spotify.track(self.el_scorcho_bad_urn)
|
||||||
|
self.assertTrue(False)
|
||||||
|
except spotipy.SpotifyException:
|
||||||
|
self.assertTrue(True)
|
||||||
|
|
||||||
def test_tracks(self):
|
def test_tracks(self):
|
||||||
results = self.spotify.tracks([self.creep_url, self.el_scorcho_urn])
|
results = self.spotify.tracks([self.creep_url, self.el_scorcho_urn])
|
||||||
self.assertTrue('tracks' in results)
|
self.assertTrue('tracks' in results)
|
||||||
@ -144,6 +152,13 @@ class TestSpotipy(unittest.TestCase):
|
|||||||
except spotipy.SpotifyException:
|
except spotipy.SpotifyException:
|
||||||
self.assertTrue(True)
|
self.assertTrue(True)
|
||||||
|
|
||||||
|
def test_track_bad_id(self):
|
||||||
|
try:
|
||||||
|
track = self.spotify.track(self.bad_id)
|
||||||
|
self.assertTrue(False)
|
||||||
|
except spotipy.SpotifyException:
|
||||||
|
self.assertTrue(True)
|
||||||
|
|
||||||
def test_unauthenticated_post_fails(self):
|
def test_unauthenticated_post_fails(self):
|
||||||
with self.assertRaises(SpotifyException) as cm:
|
with self.assertRaises(SpotifyException) as cm:
|
||||||
self.spotify.user_playlist_create("spotify", "Best hits of the 90s")
|
self.spotify.user_playlist_create("spotify", "Best hits of the 90s")
|
||||||
|
Loading…
Reference in New Issue
Block a user