change assertGreater to assertGreaterEqual in some tests (#679)

This commit is contained in:
Gustavo Krieger 2021-04-23 14:41:11 -03:00 committed by GitHub
parent c4f6a3fa4b
commit 49f46264c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -237,9 +237,8 @@ class SpotipyLibraryApiTests(unittest.TestCase):
self.spotify.track('BadID123') self.spotify.track('BadID123')
def test_current_user_saved_tracks(self): def test_current_user_saved_tracks(self):
# TODO make this not fail if someone doesnthave saved tracks
tracks = self.spotify.current_user_saved_tracks() tracks = self.spotify.current_user_saved_tracks()
self.assertGreater(len(tracks['items']), 0) self.assertGreaterEqual(len(tracks['items']), 0)
def test_current_user_save_and_unsave_tracks(self): def test_current_user_save_and_unsave_tracks(self):
tracks = self.spotify.current_user_saved_tracks() tracks = self.spotify.current_user_saved_tracks()
@ -324,7 +323,7 @@ class SpotipyUserApiTests(unittest.TestCase):
def test_current_user_top_tracks(self): def test_current_user_top_tracks(self):
response = self.spotify.current_user_top_tracks() response = self.spotify.current_user_top_tracks()
items = response['items'] items = response['items']
self.assertGreater(len(items), 0) self.assertGreaterEqual(len(items), 0)
def test_current_user_top_artists(self): def test_current_user_top_artists(self):
response = self.spotify.current_user_top_artists() response = self.spotify.current_user_top_artists()
@ -390,7 +389,7 @@ class SpotipyFollowApiTests(unittest.TestCase):
def test_current_user_follows(self): def test_current_user_follows(self):
response = self.spotify.current_user_followed_artists() response = self.spotify.current_user_followed_artists()
artists = response['artists'] artists = response['artists']
self.assertGreater(len(artists['items']), 0) self.assertGreaterEqual(len(artists['items']), 0)
def test_user_follows_and_unfollows_artist(self): def test_user_follows_and_unfollows_artist(self):
# Initially follows 1 artist # Initially follows 1 artist