Add tests for smart collection/playlist filters

This commit is contained in:
JonnyWong16 2021-06-18 14:34:53 -07:00
parent dd0e3789f6
commit e51d8253f3
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
2 changed files with 34 additions and 0 deletions

View file

@ -184,6 +184,24 @@ def test_Collection_createSmart(plex, tvshows):
collection.delete()
def test_Collection_smartFilters(plex, tvshows):
title = "test_Collection_smartFilters"
try:
collection = plex.createCollection(
title=title,
section=tvshows,
smart=True,
limit=5,
libtype="episode",
sort=["season.index:nullsLast", "episode.index:nullsLast", "show.titleSort"],
filters={"or": [{"show.title": "game"}, {'show.title': "100"}]}
)
filters = collection.filters()
assert tvshows.search(**filters) == collection.items()
finally:
collection.delete()
def test_Collection_exceptions(plex, movies, movie, artist):
title = 'test_Collection_exceptions'
try:

View file

@ -182,6 +182,22 @@ def test_Playlist_createSmart(plex, movies, movie):
playlist.delete()
def test_Playlist_smartFilters(plex, tvshows):
try:
playlist = plex.createPlaylist(
title="smart_playlist_filters",
smart=True,
section=tvshows,
limit=5,
sort=["season.index:nullsLast", "episode.index:nullsLast", "show.titleSort"],
filters={"or": [{"show.title": "game"}, {'show.title': "100"}]}
)
filters = playlist.filters()
assert tvshows.search(**filters) == playlist.items()
finally:
playlist.delete()
def test_Playlist_section(plex, movies, movie):
title = 'test_playlist_section'
try: