retrieve all continuations when limit parameter is None (closes #300)

Squashed commit of the following:

commit 3f447e39a403bea746b18e79cd7a9177a20ef79c
Merge: 8746a2a c31c8da
Author: Adrian <an3015@nyu.edu>
Date:   Sun Sep 25 12:17:44 2022 -0400

    Merge branch 'master' of https://github.com/adrinu/ytmusicapi into retrieve-all-playlists

commit 8746a2af5bdc12e5e16a87b6c69d39dde8712390
Author: Adrian <an3015@nyu.edu>
Date:   Sun Sep 25 12:17:06 2022 -0400

    Limit to other funcs

commit 5b69523003b6d0c2a00e31e1ed4a022efeabee65
Merge: b7a3e75 d36d85d
Author: Adrian <an3015@nyu.edu>
Date:   Sun Sep 25 12:07:45 2022 -0400

    Merge branch 'retrieve-all-playlists' of https://github.com/Auzzy/ytmusicapi into retrieve-all-playlists

commit c31c8dafae0c805dee68d2df19b3fe1ac454d707
Author: Adrian <an3015@nyu.edu>
Date:   Sun Sep 25 11:35:05 2022 -0400

    Limit is none implementation

commit 6768f1d66de832c17b5557c910f4b2a353386690
Merge: b7a3e75 d36d85d
Author: Adrian <an3015@nyu.edu>
Date:   Sun Sep 25 01:06:59 2022 -0400

    Merge branch 'retrieve-all-playlists' of https://github.com/Auzzy/ytmusicapi into retrieve-all-playlists

commit d36d85de9b3dff08a9997ca712817724b01608a3
Author: Austin Noto-Moniz <mathfreak65@gmail.com>
Date:   Mon May 30 16:55:53 2022 -0400

    get_library_playlists: When limit is None, return them all.
This commit is contained in:
sigma67 2022-09-26 10:36:02 +02:00
commit 1b94985014
No known key found for this signature in database
GPG key ID: 1C314227DF0103D0
5 changed files with 60 additions and 22 deletions

View file

@ -230,6 +230,17 @@ class TestYTMusic(unittest.TestCase):
playlists = self.yt_auth.get_library_playlists(50)
self.assertGreater(len(playlists), 25)
def test_get_all_library_playlists(self):
current_length = len(self.yt_auth.get_library_playlists(25))
expected_length = current_length
while expected_length <= current_length:
expected_length = current_length + 1
current_length = len(self.yt_auth.get_library_playlists(expected_length))
expected_length -= 1
playlists = self.yt_auth.get_library_playlists(None)
self.assertEqual(len(playlists), expected_length)
def test_get_library_songs(self):
songs = self.yt_brand.get_library_songs(100)
self.assertGreaterEqual(len(songs), 100)
@ -374,8 +385,15 @@ class TestYTMusic(unittest.TestCase):
###############
def test_get_library_upload_songs(self):
results = self.yt_auth.get_library_upload_songs(50, order='z_to_a')
self.assertGreater(len(results), 25)
current_length = len(self.yt_auth.get_library_upload_songs(25))
expected_length = current_length
while expected_length <= current_length:
expected_length = current_length + 1
current_length = len(self.yt_auth.get_library_upload_songs(expected_length))
expected_length -= 1
songs = self.yt_auth.get_library_upload_songs(None)
self.assertEqual(len(songs), expected_length)
@unittest.skip("Must not have any uploaded songs to pass")
def test_get_library_upload_songs_empty(self):
@ -383,8 +401,15 @@ class TestYTMusic(unittest.TestCase):
self.assertEquals(len(results), 0)
def test_get_library_upload_albums(self):
results = self.yt_auth.get_library_upload_albums(50, order='a_to_z')
self.assertGreater(len(results), 40)
current_length = len(self.yt_auth.get_library_upload_album(25))
expected_length = current_length
while expected_length <= current_length:
expected_length = current_length + 1
current_length = len(self.yt_auth.get_library_upload_album(expected_length))
expected_length -= 1
albums = self.yt_auth.get_library_upload_album(None)
self.assertEqual(len(albums), expected_length)
@unittest.skip("Must not have any uploaded albums to pass")
def test_get_library_upload_albums_empty(self):
@ -392,14 +417,22 @@ class TestYTMusic(unittest.TestCase):
self.assertEquals(len(results), 0)
def test_get_library_upload_artists(self):
results = self.yt_auth.get_library_upload_artists(50)
self.assertGreater(len(results), 25)
current_length = len(self.yt_auth.get_library_upload_artists(25))
expected_length = current_length
while expected_length <= current_length:
expected_length = current_length + 1
current_length = len(self.yt_auth.get_library_upload_artists(expected_length))
expected_length -= 1
artists = self.yt_auth.get_library_upload_artists(None)
self.assertEqual(len(artists), expected_length)
results = self.yt_auth.get_library_upload_artists(50, order='a_to_z')
self.assertGreater(len(results), 25)
self.assertGreaterEqual(len(results), current_length)
results = self.yt_auth.get_library_upload_artists(50, order='z_to_a')
self.assertGreater(len(results), 25)
self.assertGreaterEqual(len(results), current_length)
results = self.yt_auth.get_library_upload_artists(50, order='recently_added')
self.assertGreater(len(results), 25)
self.assertGreaterEqual(len(results), current_length)
@unittest.skip("Must not have any uploaded artsts to pass")
def test_get_library_upload_artists_empty(self):