python-plexapi/tests/test_history.py

101 lines
2.2 KiB
Python
Raw Normal View History

2019-11-16 21:35:20 +00:00
# -*- coding: utf-8 -*-
def test_history_Movie(movie):
movie.markPlayed()
2019-11-16 21:35:20 +00:00
history = movie.history()
assert len(history)
movie.markUnplayed()
2019-11-16 21:35:20 +00:00
def test_history_Show(show):
show.markPlayed()
2019-11-16 21:35:20 +00:00
history = show.history()
assert len(history)
show.markUnplayed()
2019-11-16 21:35:20 +00:00
def test_history_Season(show):
2020-04-15 22:30:00 +00:00
season = show.season("Season 1")
season.markPlayed()
2019-11-16 21:35:20 +00:00
history = season.history()
assert len(history)
season.markUnplayed()
2019-11-16 21:35:20 +00:00
def test_history_Episode(episode):
episode.markPlayed()
2019-11-16 21:35:20 +00:00
history = episode.history()
assert len(history)
episode.markUnplayed()
2019-11-16 21:35:20 +00:00
def test_history_Artist(artist):
artist.markPlayed()
2019-11-16 21:35:20 +00:00
history = artist.history()
assert len(history)
artist.markUnplayed()
2019-11-16 21:35:20 +00:00
def test_history_Album(album):
album.markPlayed()
2019-11-16 21:35:20 +00:00
history = album.history()
assert len(history)
album.markUnplayed()
2019-11-16 21:35:20 +00:00
def test_history_Track(track):
track.markPlayed()
2019-11-16 21:35:20 +00:00
history = track.history()
assert len(history)
track.markUnplayed()
2019-11-16 21:35:20 +00:00
def test_history_MyAccount(account, movie, show):
movie.markPlayed()
show.markPlayed()
2019-11-16 21:35:20 +00:00
history = account.history()
assert len(history)
movie.markUnplayed()
show.markUnplayed()
2019-11-16 21:35:20 +00:00
def test_history_MyLibrary(plex, movie, show):
movie.markPlayed()
show.markPlayed()
2019-11-16 21:35:20 +00:00
history = plex.library.history()
assert len(history)
movie.markUnplayed()
show.markUnplayed()
2019-11-16 21:35:20 +00:00
def test_history_MySection(plex, movie):
movie.markPlayed()
2020-04-15 22:30:00 +00:00
history = plex.library.section("Movies").history()
2019-11-16 21:35:20 +00:00
assert len(history)
movie.markUnplayed()
2019-11-16 21:35:20 +00:00
def test_history_MyServer(plex, movie):
movie.markPlayed()
2019-11-16 21:35:20 +00:00
history = plex.history()
assert len(history)
movie.markUnplayed()
2019-11-16 21:35:20 +00:00
def test_history_User(account, shared_username):
user = account.user(shared_username)
history = user.history()
def test_history_UserServer(account, shared_username, plex):
userSharedServer = account.user(shared_username).server(plex.friendlyName)
history = userSharedServer.history()
def test_history_UserSection(account, shared_username, plex):
2020-04-15 22:30:00 +00:00
userSharedServerSection = (
account.user(shared_username).server(plex.friendlyName).section("Movies")
)
2019-11-16 21:35:20 +00:00
history = userSharedServerSection.history()