no log: update some tests

pull/1808/head
Vitiko 3 years ago
parent 63eded5aa3
commit 260c765b6f

@ -63,6 +63,14 @@ def movies():
video_codec="H.264", video_codec="H.264",
year=2013, year=2013,
), ),
"inexistent": Movie(
"inexistent.movie.2013.720p.bluray.x264-sparks.mkv",
"231231asdklsad2321",
source="Blu-Ray",
resolution="720p",
video_codec="H.264",
year=2050,
),
"blade_runner": Movie( "blade_runner": Movie(
"Alien (1979) Theatrical HDR 1080p UHD BluRay x265 HEVC EAC3-SARTRE", "Alien (1979) Theatrical HDR 1080p UHD BluRay x265 HEVC EAC3-SARTRE",
"Alien", "Alien",
@ -118,4 +126,19 @@ def episodes():
resolution="720p", resolution="720p",
video_codec="H.264", video_codec="H.264",
), ),
"inexistent": Episode(
"Inexistent.TVShow.S01E01.720p.BluRay.X264-REWARD.mkv",
"121361asdfgh",
1,
1,
source="Blu-Ray",
release_group="REWARD",
resolution="720p",
video_codec="H.264",
),
} }
@pytest.fixture
def data():
return os.path.join(os.path.abspath(os.path.dirname(__file__)), "data")

@ -15,17 +15,15 @@ from subliminal_patch.providers.embeddedsubtitles import \
EmbeddedSubtitlesProvider EmbeddedSubtitlesProvider
from subzero.language import Language from subzero.language import Language
_DATA = os.path.join(os.path.abspath(os.path.dirname(__file__)), "data")
fese.Language = Language fese.Language = Language
@pytest.fixture @pytest.fixture
def video_single_language(): def video_single_language(data):
# Has only ASS streams in english # Has only ASS streams in english
return Episode( return Episode(
os.path.join(_DATA, "file_1.mkv"), os.path.join(data, "file_1.mkv"),
"Serial Experiments Lain", "Serial Experiments Lain",
1, 1,
1, 1,
@ -34,10 +32,10 @@ def video_single_language():
@pytest.fixture @pytest.fixture
def video_multiple_languages(): def video_multiple_languages(data):
# Has SubRip streams in multiple languages # Has SubRip streams in multiple languages
return Movie( return Movie(
os.path.join(_DATA, "file_2.mkv"), os.path.join(data, "file_2.mkv"),
"I'm No Longer Here", "I'm No Longer Here",
year=2019, year=2019,
source="Web", source="Web",

@ -79,6 +79,14 @@ def test_list_subtitles_movie(movies):
assert provider.list_subtitles(movies["dune"], {Language.fromalpha2("en")}) assert provider.list_subtitles(movies["dune"], {Language.fromalpha2("en")})
def test_list_subtitles_inexistent_movie(movies):
with Subf2mProvider() as provider:
assert (
provider.list_subtitles(movies["inexistent"], {Language.fromalpha2("en")})
== []
)
def test_list_subtitles_episode(episodes): def test_list_subtitles_episode(episodes):
with Subf2mProvider() as provider: with Subf2mProvider() as provider:
assert provider.list_subtitles( assert provider.list_subtitles(
@ -86,6 +94,14 @@ def test_list_subtitles_episode(episodes):
) )
def test_list_subtitles_inexistent_episode(episodes):
with Subf2mProvider() as provider:
assert (
provider.list_subtitles(episodes["inexistent"], {Language.fromalpha2("en")})
== []
)
def test_download_subtitle(subtitle): def test_download_subtitle(subtitle):
with Subf2mProvider() as provider: with Subf2mProvider() as provider:
provider.download_subtitle(subtitle) provider.download_subtitle(subtitle)

Loading…
Cancel
Save