summaryrefslogtreecommitdiffhomepage
path: root/tests/subliminal_patch/test_subdivx.py
diff options
context:
space:
mode:
authorVitiko <[email protected]>2022-04-18 20:17:51 -0400
committerVitiko <[email protected]>2022-04-18 20:17:51 -0400
commit883b0fe7a15d121ea77d2f63f582438c93ad8d76 (patch)
treeb54eb474cfaa2759f2f2481f149d188b41005493 /tests/subliminal_patch/test_subdivx.py
parenta95086555f0c799fc9072fe6a82b5141d533486a (diff)
downloadbazarr-883b0fe7a15d121ea77d2f63f582438c93ad8d76.tar.gz
bazarr-883b0fe7a15d121ea77d2f63f582438c93ad8d76.zip
Subdivx Provider: improve episode searching and downloading
Diffstat (limited to 'tests/subliminal_patch/test_subdivx.py')
-rw-r--r--tests/subliminal_patch/test_subdivx.py38
1 files changed, 28 insertions, 10 deletions
diff --git a/tests/subliminal_patch/test_subdivx.py b/tests/subliminal_patch/test_subdivx.py
index 16639becf..2b0a6c11f 100644
--- a/tests/subliminal_patch/test_subdivx.py
+++ b/tests/subliminal_patch/test_subdivx.py
@@ -1,31 +1,32 @@
# -*- coding: utf-8 -*-
import pytest
+import copy
+
from subliminal_patch.providers.subdivx import SubdivxSubtitlesProvider
from subliminal_patch.providers.subdivx import SubdivxSubtitle
+from subliminal_patch.core import SZProviderPool
from subliminal_patch.core import Episode
from subzero.language import Language
def test_list_subtitles_movie(movies):
item = movies["dune"]
with SubdivxSubtitlesProvider() as provider:
subtitles = provider.list_subtitles(item, {Language("spa", "MX")})
- assert subtitles
- assert len(subtitles) == 9
+ assert len(subtitles) >= 9
-def test_list_subtitles_episode(episodes):
- item = episodes["breaking_bad_s01e01"]
+ "episode_key,expected", [("breaking_bad_s01e01", 15), ("inexistent", 0)]
+)
+def test_list_subtitles_episode(episodes, episode_key, expected):
+ item = episodes[episode_key]
with SubdivxSubtitlesProvider() as provider:
subtitles = provider.list_subtitles(item, {Language("spa", "MX")})
- assert subtitles
- assert len(subtitles) == 15
+ assert len(subtitles) >= expected
def test_download_subtitle(movies):
subtitle = SubdivxSubtitle(
Language("spa", "MX"),
@@ -41,6 +42,24 @@ def test_download_subtitle(movies):
assert subtitle.content is not None
+def test_download_subtitle_episode_pack(episodes):
+ video = copy.copy(episodes["breaking_bad_s01e01"])
+ video.episode = 3
+
+ subtitle = SubdivxSubtitle(
+ Language("spa", "MX"),
+ video,
+ "https://www.subdivx.com/X66XMzY1NjEwX-breaking-bad-s01e0107.html",
+ "Breaking Bad S01E01-07",
+ "Son los del torrent que vienen Formato / Dimensiones 624x352 / TamaƱo 351 MB -Incluye los Torrents-",
+ "",
+ "https://www.subdivx.com/bajar.php?id=365610&u=7",
+ )
+ with SubdivxSubtitlesProvider() as provider:
+ provider.download_subtitle(subtitle)
+ assert subtitle.content is not None
+
+
@pytest.fixture
def video():
return Episode(
@@ -59,7 +78,6 @@ def video():
)
def test_subtitle_description_not_lowercase(video):
with SubdivxSubtitlesProvider() as provider:
subtitles = provider.list_subtitles(video, {Language("spa", "MX")})