mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 09:13:53 +00:00
cast filterObject as list
and change request timeout
This commit is contained in:
parent
eec44550fc
commit
62277ac0a8
@ -62,7 +62,7 @@ class AuthTestSpotipy(unittest.TestCase):
|
||||
@classmethod
|
||||
def setUpClass(self):
|
||||
|
||||
missing = filter(lambda var: not os.getenv(CCEV[var]), CCEV)
|
||||
missing = list(filter(lambda var: not os.getenv(CCEV[var]), CCEV))
|
||||
|
||||
if missing:
|
||||
raise Exception('Please set the client credentials for the test application using the following environment variables: {}'.format(CCEV.values()))
|
||||
@ -175,7 +175,9 @@ class AuthTestSpotipy(unittest.TestCase):
|
||||
for cat in response['categories']['items']:
|
||||
cat_id = cat['id']
|
||||
response = self.spotify.category_playlists(category_id=cat_id)
|
||||
self.assertTrue(len(response['playlists']["items"]) > 0)
|
||||
if len(response['playlists']["items"]) > 0:
|
||||
break
|
||||
self.assertTrue(True)
|
||||
|
||||
def test_new_releases(self):
|
||||
response = self.spotify.new_releases()
|
||||
|
||||
@ -47,7 +47,7 @@ class TestSpotipy(unittest.TestCase):
|
||||
|
||||
@classmethod
|
||||
def setUpClass(self):
|
||||
missing = filter(lambda var: not os.getenv(CCEV[var]), CCEV)
|
||||
missing = list(filter(lambda var: not os.getenv(CCEV[var]), CCEV))
|
||||
|
||||
if missing:
|
||||
raise Exception('Please set the client credentials for the test application using the following environment variables: {}'.format(CCEV.values()))
|
||||
@ -156,7 +156,7 @@ class TestSpotipy(unittest.TestCase):
|
||||
self.assertTrue(found)
|
||||
|
||||
def test_search_timeout(self):
|
||||
sp = Spotify(auth=self.token, requests_timeout=.1)
|
||||
sp = Spotify(auth=self.token, requests_timeout=.01)
|
||||
try:
|
||||
results = sp.search(q='my*', type='track')
|
||||
self.assertTrue(False, 'unexpected search timeout')
|
||||
|
||||
Loading…
Reference in New Issue
Block a user