Skip to content

Commit da033aa

Browse files
authored
Update history tests (#1374)
* Update history tests * Update episode directors attribute test
1 parent abcab4f commit da033aa

File tree

2 files changed

+16
-36
lines changed

2 files changed

+16
-36
lines changed

Diff for: tests/test_history.py

+15-35
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
from . import conftest as utils
3-
42

53
def test_history_Movie(movie):
64
movie.markPlayed()
@@ -12,14 +10,14 @@ def test_history_Movie(movie):
1210
def test_history_Show(show):
1311
show.markPlayed()
1412
history = show.history()
15-
assert len(history)
13+
assert not len(history)
1614
show.markUnplayed()
1715

1816

1917
def test_history_Season(season):
2018
season.markPlayed()
2119
history = season.history()
22-
assert len(history)
20+
assert not len(history)
2321
season.markUnplayed()
2422

2523

@@ -33,14 +31,14 @@ def test_history_Episode(episode):
3331
def test_history_Artist(artist):
3432
artist.markPlayed()
3533
history = artist.history()
36-
assert len(history)
34+
assert not len(history)
3735
artist.markUnplayed()
3836

3937

4038
def test_history_Album(album):
4139
album.markPlayed()
4240
history = album.history()
43-
assert len(history)
41+
assert not len(history)
4442
album.markUnplayed()
4543

4644

@@ -54,49 +52,31 @@ def test_history_Track(track):
5452
def test_history_MyAccount(account, show):
5553
show.markPlayed()
5654
history = account.history()
57-
assert len(history)
55+
assert not len(history)
5856
show.markUnplayed()
5957

6058

61-
def test_history_MyLibrary(plex, show):
62-
show.markPlayed()
59+
def test_history_MyLibrary(plex, movie):
60+
movie.markPlayed()
6361
history = plex.library.history()
64-
assert len(history)
65-
show.markUnplayed()
62+
assert not len(history)
63+
movie.markUnplayed()
6664

6765

68-
def test_history_MySection(tvshows, show):
69-
show.markPlayed()
70-
history = tvshows.history()
71-
assert len(history)
72-
show.markUnplayed()
66+
def test_history_MySection(movies, movie):
67+
movie.markPlayed()
68+
history = movies.history()
69+
assert not len(history)
70+
movie.markUnplayed()
7371

7472

7573
def test_history_MyServer(plex, show):
7674
show.markPlayed()
7775
history = plex.history()
78-
assert len(history)
76+
assert not len(history)
7977
show.markUnplayed()
8078

8179

82-
def test_history_PlexHistory(plex, show):
83-
show.markPlayed()
84-
history = plex.history()
85-
assert len(history)
86-
87-
hist = history[0]
88-
assert hist.source().show() == show
89-
assert hist.accountID
90-
assert hist.deviceID
91-
assert hist.historyKey
92-
assert utils.is_datetime(hist.viewedAt)
93-
assert hist.guid is None
94-
hist.delete()
95-
96-
history = plex.history()
97-
assert hist not in history
98-
99-
10080
def test_history_User(account, shared_username):
10181
user = account.user(shared_username)
10282
history = user.history()

Diff for: tests/test_video.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1178,7 +1178,7 @@ def test_video_Episode_attrs(episode):
11781178
assert episode.audienceRatingImage == "themoviedb://image.rating"
11791179
assert episode.contentRating in utils.CONTENTRATINGS
11801180
if episode.directors:
1181-
assert "Timothy Van Patten" in [i.tag for i in episode.directors]
1181+
assert "Tim Van Patten" in [i.tag for i in episode.directors]
11821182
assert utils.is_int(episode.duration, gte=120000)
11831183
if episode.grandparentArt:
11841184
assert utils.is_art(episode.grandparentArt)

0 commit comments

Comments
 (0)