2017-01-09 04:40:39 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
2017-04-15 00:47:59 +00:00
|
|
|
|
|
|
|
def test_navigate_around_show(account, plex):
|
2020-04-29 21:23:22 +00:00
|
|
|
show = plex.library.section("TV Shows").get("The 100")
|
2017-01-09 04:40:39 +00:00
|
|
|
seasons = show.seasons()
|
2020-04-29 21:23:22 +00:00
|
|
|
season = show.season("Season 1")
|
2017-01-09 04:40:39 +00:00
|
|
|
episodes = show.episodes()
|
2020-04-29 21:23:22 +00:00
|
|
|
episode = show.episode("Pilot")
|
|
|
|
assert "Season 1" in [s.title for s in seasons], "Unable to list season:"
|
|
|
|
assert "Pilot" in [e.title for e in episodes], "Unable to list episode:"
|
2020-12-30 22:58:01 +00:00
|
|
|
assert show.season(season=1) == season
|
2017-02-02 04:10:12 +00:00
|
|
|
assert show.season(1) == season
|
2020-04-29 21:23:22 +00:00
|
|
|
assert show.episode("Pilot") == episode, "Unable to get show episode:"
|
|
|
|
assert season.episode("Pilot") == episode, "Unable to get season episode:"
|
2022-02-27 03:26:08 +00:00
|
|
|
assert season.show() == show, "season.show() doesn't match expected show."
|
|
|
|
assert episode.show() == show, "episode.show() doesn't match expected show."
|
|
|
|
assert episode.season() == season, "episode.season() doesn't match expected season."
|
2017-01-09 04:40:39 +00:00
|
|
|
|
|
|
|
|
2017-04-15 00:47:59 +00:00
|
|
|
def test_navigate_around_artist(account, plex):
|
2020-04-29 21:35:18 +00:00
|
|
|
artist = plex.library.section("Music").get("Broke For Free")
|
2017-01-09 04:40:39 +00:00
|
|
|
albums = artist.albums()
|
2020-04-29 21:35:18 +00:00
|
|
|
album = artist.album("Layers")
|
2017-01-09 04:40:39 +00:00
|
|
|
tracks = artist.tracks()
|
2020-04-29 21:35:18 +00:00
|
|
|
track = artist.track("As Colourful as Ever")
|
2022-08-28 05:56:01 +00:00
|
|
|
print(f"Navigating around artist: {artist}")
|
|
|
|
print(f"Album: {album}")
|
|
|
|
print(f"Tracks: {tracks}...")
|
|
|
|
print(f"Track: {track}")
|
2023-08-29 03:29:39 +00:00
|
|
|
assert isinstance(albums, list), "Unable to list artist albums."
|
2020-04-29 21:35:18 +00:00
|
|
|
assert artist.track("As Colourful as Ever") == track, "Unable to get artist track."
|
|
|
|
assert album.track("As Colourful as Ever") == track, "Unable to get album track."
|
2022-02-27 03:26:08 +00:00
|
|
|
assert album.artist() == artist, "album.artist() doesn't match expected artist."
|
|
|
|
assert track.artist() == artist, "track.artist() doesn't match expected artist."
|
|
|
|
assert track.album() == album, "track.album() doesn't match expected album."
|