mirror of
https://github.com/pkkid/python-plexapi
synced 2025-02-16 12:58:26 +00:00
subtitle tests
test for episode subtitles test for uploading, selecting, and removing a subtitle
This commit is contained in:
parent
05fb2370c5
commit
b21d897d30
1 changed files with 23 additions and 0 deletions
|
@ -83,6 +83,29 @@ def test_video_Movie_download(monkeydownload, tmpdir, movie):
|
|||
def test_video_Movie_subtitlestreams(movie):
|
||||
assert not movie.subtitleStreams()
|
||||
|
||||
def test_video_Episode_subtitlestreams(episode):
|
||||
assert not episode.subtitleStreams()
|
||||
|
||||
def test_video_Movie_upload_select_remove_subtitle(movie, subtitle):
|
||||
import os
|
||||
filepath = os.path.realpath(subtitle.name)
|
||||
movie.uploadSubtitles(filepath)
|
||||
subtitles = [sub.title for sub in movie.subtitleStreams()]
|
||||
subname = subtitle.name.rsplit('.', 1)[0]
|
||||
assert subname in subtitles
|
||||
|
||||
subtitleSelection = movie.subtitleStreams()[0]
|
||||
movie.selectSubtitle(streamID=subtitleSelection.id)
|
||||
|
||||
subtitleSelection = movie.subtitleStreams()[0]
|
||||
assert subtitleSelection.selected
|
||||
|
||||
movie.removeSubtitles(streamTitle=subname)
|
||||
subtitles = [sub.title for sub in movie.subtitleStreams()]
|
||||
assert subname not in subtitles
|
||||
|
||||
if subtitle:
|
||||
os.remove(filepath)
|
||||
|
||||
def test_video_Movie_attrs(movies):
|
||||
movie = movies.get('Sita Sings the Blues')
|
||||
|
|
Loading…
Add table
Reference in a new issue