Skip to content

Commit 6338a2b

Browse files
committed
Added misc. page tests. Fixed misc. comments.
1 parent 952abc4 commit 6338a2b

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

tests/test_page.py

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#
1616
# You should have received a copy of the GNU Lesser General Public License
1717
# along with this program. If not, see <http://www.gnu.org/licenses/>.
18-
import pytest
1918

2019
import tidalapi
2120

@@ -48,13 +47,15 @@ def test_get_explore_items(session):
4847
assert first_item.categories[1].title == "Milestone Year Albums"
4948
assert first_item.categories[2].title == "Albums Of The Decade"
5049
playlist = first_item.categories[0].items[0]
50+
assert isinstance(playlist, tidalapi.Playlist)
5151
assert playlist.name # == 'Remember...the 1950s'
5252
assert playlist.num_tracks > 1
5353
assert playlist.num_videos == 0
5454

5555
genre_genres = explore.categories[0].items[1]
5656
genre_genres_page_items = iter(genre_genres.get())
5757
playlist = next(genre_genres_page_items) # Usually a playlist
58+
assert isinstance(playlist, tidalapi.Playlist)
5859
assert playlist.name # == 'Remember...the 1950s'
5960
assert playlist.num_tracks > 1
6061
assert playlist.num_videos == 0
@@ -66,9 +67,25 @@ def test_get_explore_items(session):
6667
assert next(iterator).title == "Country"
6768

6869

70+
def test_hires_page(session):
71+
hires = session.hires_page()
72+
first = next(iter(hires))
73+
assert first.name == "Electronic: Headphone Classics"
74+
assert isinstance(first, tidalapi.Playlist)
75+
76+
6977
def test_for_you(session):
7078
for_you = session.for_you()
71-
assert for_you
79+
first = next(iter(for_you))
80+
assert first.title == "My Daily Discovery"
81+
assert isinstance(first, tidalapi.Mix)
82+
83+
84+
def test_videos(session):
85+
videos = session.videos()
86+
first = next(iter(videos))
87+
assert first.type == "VIDEO"
88+
assert isinstance(first.get(), tidalapi.Video)
7289

7390

7491
def test_show_more(session):

tidalapi/playlist.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -495,8 +495,8 @@ def add(
495495
:param allow_duplicates: Allow adding duplicate items
496496
:param position: Insert items at a specific position.
497497
Default: insert at the end of the playlist
498-
:param position: Maximum number of items to add
499-
:return: True, if successful.
498+
:param limit: Maximum number of items to add
499+
:return: List of media IDs that has been added
500500
"""
501501
media_ids = list_validate(media_ids)
502502
# Insert items at a specific index
@@ -535,7 +535,7 @@ def merge(
535535
tracks will be skipped.
536536
:param allow_missing: If true, missing tracks are allowed. Otherwise, exception
537537
will be thrown
538-
:return:
538+
:return: List of items that has been added from the playlist
539539
"""
540540
data = {
541541
"fromPlaylistUuid": str(playlist),

0 commit comments

Comments
 (0)