mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-22 11:43:13 +00:00
Fix collections and playlists tests
This commit is contained in:
parent
06da110203
commit
6f2ef5c519
4 changed files with 15 additions and 15 deletions
|
@ -182,7 +182,7 @@ def test_Collection_createSmart(plex, tvshows):
|
|||
def test_Collection_exceptions(plex, movies, movie, artist):
|
||||
title = 'test_Collection_exceptions'
|
||||
try:
|
||||
collection = plex.createCollection(title, movies, movie)
|
||||
collection = plex.createCollection(title, section=movies, items=movie)
|
||||
with pytest.raises(BadRequest):
|
||||
collection.updateFilters()
|
||||
with pytest.raises(BadRequest):
|
||||
|
@ -191,9 +191,9 @@ def test_Collection_exceptions(plex, movies, movie, artist):
|
|||
collection.delete()
|
||||
|
||||
with pytest.raises(BadRequest):
|
||||
plex.createCollection(title, movies, items=[])
|
||||
plex.createCollection(title, section=movies, items=[])
|
||||
with pytest.raises(BadRequest):
|
||||
plex.createCollection(title, movies, items=[movie, artist])
|
||||
plex.createCollection(title, section=movies, items=[movie, artist])
|
||||
|
||||
try:
|
||||
collection = plex.createCollection(title, smart=True, section=movies, **{'year>>': 2000})
|
||||
|
@ -212,7 +212,7 @@ def test_Collection_posters(collection):
|
|||
|
||||
def test_Collection_art(collection):
|
||||
arts = collection.arts()
|
||||
assert arts
|
||||
assert not arts # Collection has no default art
|
||||
|
||||
|
||||
def test_Collection_mixins_images(collection):
|
||||
|
|
|
@ -9,7 +9,7 @@ def test_create_playlist(plex, show):
|
|||
# create the playlist
|
||||
title = 'test_create_playlist_show'
|
||||
episodes = show.episodes()
|
||||
playlist = plex.createPlaylist(title, episodes[:3])
|
||||
playlist = plex.createPlaylist(title, items=episodes[:3])
|
||||
try:
|
||||
items = playlist.items()
|
||||
# Test create playlist
|
||||
|
@ -62,7 +62,7 @@ def test_playlist_edit(plex, movie):
|
|||
new_title = 'test_playlist_edit_new_title'
|
||||
new_summary = 'test_playlist_edit_summary'
|
||||
try:
|
||||
playlist = plex.createPlaylist(title, movie)
|
||||
playlist = plex.createPlaylist(title, items=movie)
|
||||
assert playlist.title == title
|
||||
assert playlist.summary == ''
|
||||
playlist.edit(title=new_title, summary=new_summary)
|
||||
|
@ -77,7 +77,7 @@ def test_playlist_item(plex, show):
|
|||
title = 'test_playlist_item'
|
||||
episodes = show.episodes()
|
||||
try:
|
||||
playlist = plex.createPlaylist(title, episodes[:3])
|
||||
playlist = plex.createPlaylist(title, items=episodes[:3])
|
||||
item1 = playlist.item("Winter Is Coming")
|
||||
assert item1 in playlist.items()
|
||||
item2 = playlist.get("Winter Is Coming")
|
||||
|
@ -93,7 +93,7 @@ def test_playlist_item(plex, show):
|
|||
def test_playlist_play(plex, client, artist, album):
|
||||
try:
|
||||
playlist_name = 'test_play_playlist'
|
||||
playlist = plex.createPlaylist(playlist_name, album)
|
||||
playlist = plex.createPlaylist(playlist_name, items=album)
|
||||
client.playMedia(playlist); time.sleep(5)
|
||||
client.stop('music'); time.sleep(1)
|
||||
finally:
|
||||
|
@ -106,7 +106,7 @@ def test_playlist_photos(plex, photoalbum):
|
|||
photos = album.photos()
|
||||
try:
|
||||
playlist_name = 'test_playlist_photos'
|
||||
playlist = plex.createPlaylist(playlist_name, photos)
|
||||
playlist = plex.createPlaylist(playlist_name, items=photos)
|
||||
assert len(playlist.items()) >= 1
|
||||
finally:
|
||||
playlist.delete()
|
||||
|
@ -123,7 +123,7 @@ def test_play_photos(plex, client, photoalbum):
|
|||
|
||||
def test_copyToUser(plex, show, fresh_plex, shared_username):
|
||||
episodes = show.episodes()
|
||||
playlist = plex.createPlaylist('shared_from_test_plexapi', episodes)
|
||||
playlist = plex.createPlaylist('shared_from_test_plexapi', items=episodes)
|
||||
try:
|
||||
playlist.copyToUser(shared_username)
|
||||
user = plex.myPlexAccount().user(shared_username)
|
||||
|
@ -158,7 +158,7 @@ def test_smart_playlist(plex, movies, movie):
|
|||
def test_smart_playlist_section(plex, movies, movie):
|
||||
title = 'test_playlist_section'
|
||||
try:
|
||||
playlist = plex.createPlaylist(title, movie)
|
||||
playlist = plex.createPlaylist(title, items=movie)
|
||||
with pytest.raises(BadRequest):
|
||||
playlist.section()
|
||||
finally:
|
||||
|
@ -181,7 +181,7 @@ def test_smart_playlist_section(plex, movies, movie):
|
|||
def test_playlist_exceptions(plex, movies, movie, artist):
|
||||
title = 'test_playlist_exceptions'
|
||||
try:
|
||||
playlist = plex.createPlaylist(title, movie)
|
||||
playlist = plex.createPlaylist(title, items=movie)
|
||||
with pytest.raises(BadRequest):
|
||||
playlist.updateFilters()
|
||||
with pytest.raises(BadRequest):
|
||||
|
|
|
@ -130,7 +130,7 @@ def test_modify_playqueue_with_library_media(plex, show):
|
|||
|
||||
def test_create_playqueue_from_playlist(plex, album):
|
||||
try:
|
||||
playlist = plex.createPlaylist("test_playlist", album)
|
||||
playlist = plex.createPlaylist("test_playlist", items=album)
|
||||
pq = playlist.playQueue(shuffle=1)
|
||||
assert pq.playQueueShuffled is True
|
||||
assert len(playlist) == len(album.tracks())
|
||||
|
|
|
@ -146,7 +146,7 @@ def test_server_search(plex, movie):
|
|||
|
||||
def test_server_playlist(plex, show):
|
||||
episodes = show.episodes()
|
||||
playlist = plex.createPlaylist("test_playlist", episodes[:3])
|
||||
playlist = plex.createPlaylist("test_playlist", items=episodes[:3])
|
||||
try:
|
||||
assert playlist.title == "test_playlist"
|
||||
with pytest.raises(NotFound):
|
||||
|
@ -159,7 +159,7 @@ def test_server_playlists(plex, show):
|
|||
playlists = plex.playlists()
|
||||
count = len(playlists)
|
||||
episodes = show.episodes()
|
||||
playlist = plex.createPlaylist("test_playlist", episodes[:3])
|
||||
playlist = plex.createPlaylist("test_playlist", items=episodes[:3])
|
||||
try:
|
||||
playlists = plex.playlists()
|
||||
assert len(playlists) == count + 1
|
||||
|
|
Loading…
Reference in a new issue