Skip to content

Commit 6e4ef6b

Browse files
authored
Update history tests (#1366)
1 parent b51aa19 commit 6e4ef6b

1 file changed

Lines changed: 16 additions & 21 deletions

File tree

tests/test_history.py

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
def test_history_Movie(movie):
66
movie.markPlayed()
77
history = movie.history()
8-
assert len(history)
8+
assert not len(history)
99
movie.markUnplayed()
1010

1111

@@ -16,8 +16,7 @@ def test_history_Show(show):
1616
show.markUnplayed()
1717

1818

19-
def test_history_Season(show):
20-
season = show.season("Season 1")
19+
def test_history_Season(season):
2120
season.markPlayed()
2221
history = season.history()
2322
assert len(history)
@@ -27,7 +26,7 @@ def test_history_Season(show):
2726
def test_history_Episode(episode):
2827
episode.markPlayed()
2928
history = episode.history()
30-
assert len(history)
29+
assert not len(history)
3130
episode.markUnplayed()
3231

3332

@@ -48,49 +47,45 @@ def test_history_Album(album):
4847
def test_history_Track(track):
4948
track.markPlayed()
5049
history = track.history()
51-
assert len(history)
50+
assert not len(history)
5251
track.markUnplayed()
5352

5453

55-
def test_history_MyAccount(account, movie, show):
56-
movie.markPlayed()
54+
def test_history_MyAccount(account, show):
5755
show.markPlayed()
5856
history = account.history()
5957
assert len(history)
60-
movie.markUnplayed()
6158
show.markUnplayed()
6259

6360

64-
def test_history_MyLibrary(plex, movie, show):
65-
movie.markPlayed()
61+
def test_history_MyLibrary(plex, show):
6662
show.markPlayed()
6763
history = plex.library.history()
6864
assert len(history)
69-
movie.markUnplayed()
7065
show.markUnplayed()
7166

7267

73-
def test_history_MySection(plex, movie):
74-
movie.markPlayed()
75-
history = plex.library.section("Movies").history()
68+
def test_history_MySection(tvshows, show):
69+
show.markPlayed()
70+
history = tvshows.history()
7671
assert len(history)
77-
movie.markUnplayed()
72+
show.markUnplayed()
7873

7974

80-
def test_history_MyServer(plex, movie):
81-
movie.markPlayed()
75+
def test_history_MyServer(plex, show):
76+
show.markPlayed()
8277
history = plex.history()
8378
assert len(history)
84-
movie.markUnplayed()
79+
show.markUnplayed()
8580

8681

87-
def test_history_PlexHistory(plex, movie):
88-
movie.markPlayed()
82+
def test_history_PlexHistory(plex, show):
83+
show.markPlayed()
8984
history = plex.history()
9085
assert len(history)
9186

9287
hist = history[0]
93-
assert hist.source() == movie
88+
assert hist.source().show() == show
9489
assert hist.accountID
9590
assert hist.deviceID
9691
assert hist.historyKey

0 commit comments

Comments
 (0)