Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update history tests #1366

Merged
merged 1 commit into from
Feb 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 16 additions & 21 deletions tests/test_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
def test_history_Movie(movie):
movie.markPlayed()
history = movie.history()
assert len(history)
assert not len(history)
movie.markUnplayed()


Expand All @@ -16,8 +16,7 @@ def test_history_Show(show):
show.markUnplayed()


def test_history_Season(show):
season = show.season("Season 1")
def test_history_Season(season):
season.markPlayed()
history = season.history()
assert len(history)
Expand All @@ -27,7 +26,7 @@ def test_history_Season(show):
def test_history_Episode(episode):
episode.markPlayed()
history = episode.history()
assert len(history)
assert not len(history)
episode.markUnplayed()


Expand All @@ -48,49 +47,45 @@ def test_history_Album(album):
def test_history_Track(track):
track.markPlayed()
history = track.history()
assert len(history)
assert not len(history)
track.markUnplayed()


def test_history_MyAccount(account, movie, show):
movie.markPlayed()
def test_history_MyAccount(account, show):
show.markPlayed()
history = account.history()
assert len(history)
movie.markUnplayed()
show.markUnplayed()


def test_history_MyLibrary(plex, movie, show):
movie.markPlayed()
def test_history_MyLibrary(plex, show):
show.markPlayed()
history = plex.library.history()
assert len(history)
movie.markUnplayed()
show.markUnplayed()


def test_history_MySection(plex, movie):
movie.markPlayed()
history = plex.library.section("Movies").history()
def test_history_MySection(tvshows, show):
show.markPlayed()
history = tvshows.history()
assert len(history)
movie.markUnplayed()
show.markUnplayed()


def test_history_MyServer(plex, movie):
movie.markPlayed()
def test_history_MyServer(plex, show):
show.markPlayed()
history = plex.history()
assert len(history)
movie.markUnplayed()
show.markUnplayed()


def test_history_PlexHistory(plex, movie):
movie.markPlayed()
def test_history_PlexHistory(plex, show):
show.markPlayed()
history = plex.history()
assert len(history)

hist = history[0]
assert hist.source() == movie
assert hist.source().show() == show
assert hist.accountID
assert hist.deviceID
assert hist.historyKey
Expand Down
Loading