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()
2024-02-17 22:05:34 +00:00
assert not 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 not len(history)
show.markUnplayed()
2019-11-16 21:35:20 +00:00
2024-02-17 22:05:34 +00:00
def test_history_Season(season):
season.markPlayed()
2019-11-16 21:35:20 +00:00
history = season.history()
assert not 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()
2024-02-17 22:05:34 +00:00
assert not 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 not 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 not 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()
2024-02-17 22:05:34 +00:00
assert not len(history)
track.markUnplayed()
2019-11-16 21:35:20 +00:00
2024-02-17 22:05:34 +00:00
def test_history_MyAccount(account, show):
show.markPlayed()
2019-11-16 21:35:20 +00:00
history = account.history()
assert not len(history)
show.markUnplayed()
2019-11-16 21:35:20 +00:00
def test_history_MyLibrary(plex, movie):
movie.markPlayed()
2019-11-16 21:35:20 +00:00
history = plex.library.history()
assert not len(history)
movie.markUnplayed()
2019-11-16 21:35:20 +00:00
def test_history_MySection(movies, movie):
movie.markPlayed()
history = movies.history()
assert not len(history)
movie.markUnplayed()
2019-11-16 21:35:20 +00:00
2024-02-17 22:05:34 +00:00
def test_history_MyServer(plex, show):
show.markPlayed()
2019-11-16 21:35:20 +00:00
history = plex.history()
assert not len(history)
2024-02-17 22:05:34 +00:00
show.markUnplayed()
2019-11-16 21:35:20 +00:00
def test_history_User(account, shared_username):
user = account.user(shared_username)
history = user.history()
2023-08-29 03:29:39 +00:00
assert isinstance(history, list)
2019-11-16 21:35:20 +00:00
def test_history_UserServer(account, shared_username, plex):
userSharedServer = account.user(shared_username).server(plex.friendlyName)
history = userSharedServer.history()
2023-08-29 03:29:39 +00:00
assert isinstance(history, list)
2019-11-16 21:35:20 +00:00
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()
2023-08-29 03:29:39 +00:00
assert isinstance(history, list)