Skip to content

Commit bf925c6

Browse files
authored
addToWatchlist raise NotFound exception for invalid media (#1401)
1 parent f5126a7 commit bf925c6

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

plexapi/myplex.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,9 @@ def addToWatchlist(self, items):
963963
objects to be added to the watchlist.
964964
965965
Raises:
966-
:exc:`~plexapi.exceptions.BadRequest`: When trying to add invalid or existing
966+
:exc:`~plexapi.exceptions.BadRequest`: When trying to add existing
967+
media to the watchlist.
968+
:exc:`~plexapi.exceptions.NotFound`: When trying to add invalid
967969
media to the watchlist.
968970
"""
969971
if not isinstance(items, list):

tests/test_myplex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def test_myplex_watchlist(account, movie, show, artist):
310310
account.removeFromWatchlist(movie)
311311

312312
# Test adding invalid item to watchlist
313-
with pytest.raises(BadRequest):
313+
with pytest.raises(NotFound):
314314
account.addToWatchlist(artist)
315315

316316

0 commit comments

Comments
 (0)