2019-11-16 21:35:20 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
def test_history_Movie(movie):
|
2022-08-26 19:14:24 +00:00
|
|
|
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)
|
2022-08-26 19:14:24 +00:00
|
|
|
movie.markUnplayed()
|
2019-11-16 21:35:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_history_Show(show):
|
2022-08-26 19:14:24 +00:00
|
|
|
show.markPlayed()
|
2019-11-16 21:35:20 +00:00
|
|
|
history = show.history()
|
2024-03-16 03:21:23 +00:00
|
|
|
assert not len(history)
|
2022-08-26 19:14:24 +00:00
|
|
|
show.markUnplayed()
|
2019-11-16 21:35:20 +00:00
|
|
|
|
|
|
|
|
2024-02-17 22:05:34 +00:00
|
|
|
def test_history_Season(season):
|
2022-08-26 19:14:24 +00:00
|
|
|
season.markPlayed()
|
2019-11-16 21:35:20 +00:00
|
|
|
history = season.history()
|
2024-03-16 03:21:23 +00:00
|
|
|
assert not len(history)
|
2022-08-26 19:14:24 +00:00
|
|
|
season.markUnplayed()
|
2019-11-16 21:35:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_history_Episode(episode):
|
2022-08-26 19:14:24 +00:00
|
|
|
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)
|
2022-08-26 19:14:24 +00:00
|
|
|
episode.markUnplayed()
|
2019-11-16 21:35:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_history_Artist(artist):
|
2022-08-26 19:14:24 +00:00
|
|
|
artist.markPlayed()
|
2019-11-16 21:35:20 +00:00
|
|
|
history = artist.history()
|
2024-03-16 03:21:23 +00:00
|
|
|
assert not len(history)
|
2022-08-26 19:14:24 +00:00
|
|
|
artist.markUnplayed()
|
2019-11-16 21:35:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_history_Album(album):
|
2022-08-26 19:14:24 +00:00
|
|
|
album.markPlayed()
|
2019-11-16 21:35:20 +00:00
|
|
|
history = album.history()
|
2024-03-16 03:21:23 +00:00
|
|
|
assert not len(history)
|
2022-08-26 19:14:24 +00:00
|
|
|
album.markUnplayed()
|
2019-11-16 21:35:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
def test_history_Track(track):
|
2022-08-26 19:14:24 +00:00
|
|
|
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)
|
2022-08-26 19:14:24 +00:00
|
|
|
track.markUnplayed()
|
2019-11-16 21:35:20 +00:00
|
|
|
|
|
|
|
|
2024-02-17 22:05:34 +00:00
|
|
|
def test_history_MyAccount(account, show):
|
2022-08-26 19:14:24 +00:00
|
|
|
show.markPlayed()
|
2019-11-16 21:35:20 +00:00
|
|
|
history = account.history()
|
2024-03-16 03:21:23 +00:00
|
|
|
assert not len(history)
|
2022-08-26 19:14:24 +00:00
|
|
|
show.markUnplayed()
|
2019-11-16 21:35:20 +00:00
|
|
|
|
|
|
|
|
2024-03-16 03:21:23 +00:00
|
|
|
def test_history_MyLibrary(plex, movie):
|
|
|
|
movie.markPlayed()
|
2019-11-16 21:35:20 +00:00
|
|
|
history = plex.library.history()
|
2024-03-16 03:21:23 +00:00
|
|
|
assert not len(history)
|
|
|
|
movie.markUnplayed()
|
2019-11-16 21:35:20 +00:00
|
|
|
|
|
|
|
|
2024-03-16 03:21:23 +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()
|
2024-03-16 03:21:23 +00:00
|
|
|
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)
|