Fix continuations for some library functions
Update tests, reduce code duplication
This commit is contained in:
parent
abbc13f7af
commit
d97d88d4ef
5 changed files with 50 additions and 88 deletions
|
|
@ -111,7 +111,7 @@ class TestYTMusic(unittest.TestCase):
|
|||
|
||||
def test_get_watch_playlist(self):
|
||||
playlist = youtube_auth.get_watch_playlist("9mWr4c_ig54", limit=50)
|
||||
self.assertGreater(len(playlist['tracks']), 50)
|
||||
self.assertGreater(len(playlist['tracks']), 45)
|
||||
playlist = youtube_auth.get_watch_playlist("UoAf_y9Ok4k") # private track
|
||||
self.assertGreaterEqual(len(playlist['tracks']), 25)
|
||||
|
||||
|
|
@ -131,7 +131,7 @@ class TestYTMusic(unittest.TestCase):
|
|||
|
||||
def test_get_library_playlists(self):
|
||||
playlists = youtube_brand.get_library_playlists(50)
|
||||
self.assertGreater(len(playlists), 0)
|
||||
self.assertGreater(len(playlists), 25)
|
||||
|
||||
def test_get_library_songs(self):
|
||||
songs = youtube_brand.get_library_songs(100)
|
||||
|
|
@ -146,34 +146,34 @@ class TestYTMusic(unittest.TestCase):
|
|||
self.assertGreaterEqual(len(songs), 25)
|
||||
|
||||
def test_get_library_albums(self):
|
||||
albums = youtube_brand.get_library_albums(100)
|
||||
self.assertGreater(len(albums), 0)
|
||||
albums = youtube_auth.get_library_albums(100)
|
||||
self.assertGreater(len(albums), 50)
|
||||
albums = youtube_brand.get_library_albums(100, order='a_to_z')
|
||||
self.assertGreater(len(albums), 0)
|
||||
self.assertGreater(len(albums), 50)
|
||||
albums = youtube_brand.get_library_albums(100, order='z_to_a')
|
||||
self.assertGreater(len(albums), 0)
|
||||
self.assertGreater(len(albums), 50)
|
||||
albums = youtube_brand.get_library_albums(100, order='recently_added')
|
||||
self.assertGreater(len(albums), 0)
|
||||
self.assertGreater(len(albums), 50)
|
||||
|
||||
def test_get_library_artists(self):
|
||||
artists = youtube_brand.get_library_artists(100)
|
||||
self.assertGreater(len(artists), 0)
|
||||
artists = youtube_brand.get_library_artists(order='a_to_z')
|
||||
self.assertGreater(len(artists), 0)
|
||||
artists = youtube_brand.get_library_artists(50)
|
||||
self.assertGreater(len(artists), 40)
|
||||
artists = youtube_brand.get_library_artists(order='a_to_z', limit=50)
|
||||
self.assertGreater(len(artists), 40)
|
||||
artists = youtube_brand.get_library_artists(order='z_to_a')
|
||||
self.assertGreater(len(artists), 0)
|
||||
self.assertGreater(len(artists), 20)
|
||||
artists = youtube_brand.get_library_artists(order='recently_added')
|
||||
self.assertGreater(len(artists), 0)
|
||||
self.assertGreater(len(artists), 20)
|
||||
|
||||
def test_get_library_subscriptions(self):
|
||||
artists = youtube_brand.get_library_subscriptions(50)
|
||||
self.assertGreater(len(artists), 0)
|
||||
self.assertGreater(len(artists), 40)
|
||||
artists = youtube_brand.get_library_subscriptions(order='a_to_z')
|
||||
self.assertGreater(len(artists), 0)
|
||||
self.assertGreater(len(artists), 20)
|
||||
artists = youtube_brand.get_library_subscriptions(order='z_to_a')
|
||||
self.assertGreater(len(artists), 0)
|
||||
self.assertGreater(len(artists), 20)
|
||||
artists = youtube_brand.get_library_subscriptions(order='recently_added')
|
||||
self.assertGreater(len(artists), 0)
|
||||
self.assertGreater(len(artists), 20)
|
||||
|
||||
def test_get_liked_songs(self):
|
||||
songs = youtube_brand.get_liked_songs(200)
|
||||
|
|
@ -270,15 +270,8 @@ class TestYTMusic(unittest.TestCase):
|
|||
###############
|
||||
|
||||
def test_get_library_upload_songs(self):
|
||||
results = youtube_auth.get_library_upload_songs(100)
|
||||
results = youtube_auth.get_library_upload_songs(50)
|
||||
self.assertGreater(len(results), 25)
|
||||
results = youtube_auth.get_library_upload_songs(100, 'a_to_z')
|
||||
self.assertGreater(len(results), 25)
|
||||
results = youtube_auth.get_library_upload_songs(100, 'z_to_a')
|
||||
self.assertGreater(len(results), 25)
|
||||
results = youtube_auth.get_library_upload_songs(100, 'recently_added')
|
||||
self.assertGreater(len(results), 25)
|
||||
# There is no way to check if the order is correct.
|
||||
|
||||
@unittest.skip("Must not have any uploaded songs to pass")
|
||||
def test_get_library_upload_songs_empty(self):
|
||||
|
|
@ -287,13 +280,7 @@ class TestYTMusic(unittest.TestCase):
|
|||
|
||||
def test_get_library_upload_albums(self):
|
||||
results = youtube_auth.get_library_upload_albums(50)
|
||||
self.assertGreater(len(results), 25)
|
||||
results = youtube_auth.get_library_upload_albums(50, order='a_to_z')
|
||||
self.assertGreater(len(results), 25)
|
||||
results = youtube_auth.get_library_upload_albums(50, order='z_to_a')
|
||||
self.assertGreater(len(results), 25)
|
||||
results = youtube_auth.get_library_upload_albums(50, order='recently_added')
|
||||
self.assertGreater(len(results), 25)
|
||||
self.assertGreater(len(results), 40)
|
||||
|
||||
@unittest.skip("Must not have any uploaded albums to pass")
|
||||
def test_get_library_upload_albums_empty(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue