mirror of
https://github.com/pkkid/python-plexapi
synced 2024-11-25 05:00:22 +00:00
Fix rating mixin tests
This commit is contained in:
parent
bd8cdb10b7
commit
b269140943
3 changed files with 9 additions and 2 deletions
|
@ -6,9 +6,11 @@ def test_mark_movie_watched(movie):
|
|||
print('Marking movie watched: %s' % movie)
|
||||
print('View count: %s' % movie.viewCount)
|
||||
movie.markWatched()
|
||||
movie.reload()
|
||||
print('View count: %s' % movie.viewCount)
|
||||
assert movie.viewCount == 1, 'View count 0 after watched.'
|
||||
movie.markUnwatched()
|
||||
movie.reload()
|
||||
print('View count: %s' % movie.viewCount)
|
||||
assert movie.viewCount == 0, 'View count 1 after unwatched.'
|
||||
|
||||
|
|
|
@ -185,8 +185,9 @@ def edit_rating(obj):
|
|||
assert utils.is_datetime(obj.lastRatedAt)
|
||||
assert obj.userRating == 10.0
|
||||
obj.rate()
|
||||
obj.reload()
|
||||
assert obj.lastRatedAt is None
|
||||
# Cannot use obj.reload() since PlexObject.__setattr__()
|
||||
# will not overwrite userRating with None
|
||||
obj = obj.fetchItem(obj._details_key)
|
||||
assert obj.userRating is None
|
||||
with pytest.raises(BadRequest):
|
||||
assert obj.rate('bad-rating')
|
||||
|
|
|
@ -697,11 +697,13 @@ def test_video_Show_analyze(show):
|
|||
|
||||
def test_video_Show_markWatched(show):
|
||||
show.markWatched()
|
||||
show.reload()
|
||||
assert show.isWatched
|
||||
|
||||
|
||||
def test_video_Show_markUnwatched(show):
|
||||
show.markUnwatched()
|
||||
show.reload()
|
||||
assert not show.isWatched
|
||||
|
||||
|
||||
|
@ -814,12 +816,14 @@ def test_video_Season_show(show):
|
|||
def test_video_Season_watched(show):
|
||||
season = show.season("Season 1")
|
||||
season.markWatched()
|
||||
season.reload()
|
||||
assert season.isWatched
|
||||
|
||||
|
||||
def test_video_Season_unwatched(show):
|
||||
season = show.season("Season 1")
|
||||
season.markUnwatched()
|
||||
season.reload()
|
||||
assert not season.isWatched
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue