Add tests for global categories, releases, fix bugged tests (#893)

This commit is contained in:
Kevin Sekuj authored and GitHub committed 2022-11-26 09:29:53 +00:00
1 parent edcd322845
commit 5201f58247
3 files changed
+19 -1

No files matched your search

@@ -158,6 +158,8 @@ class AuthTestSpotipy(unittest.TestCase):
results = self.spotify.artist_related_artists(self.weezer_urn)
self.assertTrue('artists' in results)
self.assertTrue(len(results['artists']) == 20)
found = False
for artist in results['artists']:
if artist['name'] == 'Jimmy Eat World':
found = True
+13 -1
View File
@@ -364,6 +364,10 @@ class SpotipyBrowseApiTests(unittest.TestCase):
response = self.spotify.categories(country='US')
self.assertGreater(len(response['categories']), 0)
def test_categories_global(self):
response = self.spotify.categories()
self.assertGreater(len(response['categories']), 0)
def test_categories_locale(self):
response = self.spotify.categories(locale='en_US')
self.assertGreater(len(response['categories']), 0)
@@ -405,7 +409,15 @@ class SpotipyBrowseApiTests(unittest.TestCase):
def test_new_releases(self):
response = self.spotify.new_releases()
self.assertGreater(len(response['albums']), 0)
self.assertGreater(len(response['albums']['items']), 0)
def test_new_releases_limit_low(self):
response = self.spotify.new_releases(limit=1)
self.assertEqual(len(response['albums']['items']), 1)
def test_new_releases_limit_high(self):
response = self.spotify.new_releases(limit=50)
self.assertLessEqual(len(response['albums']['items']), 50)
def test_featured_releases(self):
response = self.spotify.featured_playlists()