addToWatchlist raise NotFound exception for invalid media (#1401)

This commit is contained in:
JonnyWong16 2024-04-19 10:52:19 -07:00 committed by GitHub
parent f5126a7ff1
commit bf925c60e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View file

@ -963,7 +963,9 @@ class MyPlexAccount(PlexObject):
objects to be added to the watchlist.
Raises:
:exc:`~plexapi.exceptions.BadRequest`: When trying to add invalid or existing
:exc:`~plexapi.exceptions.BadRequest`: When trying to add existing
media to the watchlist.
:exc:`~plexapi.exceptions.NotFound`: When trying to add invalid
media to the watchlist.
"""
if not isinstance(items, list):

View file

@ -310,7 +310,7 @@ def test_myplex_watchlist(account, movie, show, artist):
account.removeFromWatchlist(movie)
# Test adding invalid item to watchlist
with pytest.raises(BadRequest):
with pytest.raises(NotFound):
account.addToWatchlist(artist)