summaryrefslogtreecommitdiffhomepage
path: root/tests/subliminal_patch/test_subtitrarinoi.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/subliminal_patch/test_subtitrarinoi.py')
-rw-r--r--tests/subliminal_patch/test_subtitrarinoi.py54
1 files changed, 54 insertions, 0 deletions
diff --git a/tests/subliminal_patch/test_subtitrarinoi.py b/tests/subliminal_patch/test_subtitrarinoi.py
new file mode 100644
index 000000000..816e8db4f
--- /dev/null
+++ b/tests/subliminal_patch/test_subtitrarinoi.py
@@ -0,0 +1,54 @@
+import pytest
+from subliminal_patch.providers.subtitrarinoi import SubtitrarinoiProvider
+from subliminal_patch.providers.subtitrarinoi import SubtitrarinoiSubtitle
+from subzero.language import Language
+
+romanian = Language("ron")
+
+
+def test_list_subtitles(episodes):
+ episode = episodes["breaking_bad_s01e01"]
+ with SubtitrarinoiProvider() as provider:
+ assert provider.list_subtitles(episode, [romanian])
+
+
+def subtitrari_subtitle():
+ yield SubtitrarinoiSubtitle(
+ romanian,
+ "https://www.subtitrari-noi.ro/7493-subtitrari noi.ro\ ",
+ 3,
+ "Sezonul 1 ep. 1-7 Sincronizari si pentru variantele HDTV x264 (Sincro atty)",
+ "Breaking Bad",
+ "tt0903747/",
+ "Alice",
+ "https://www.subtitrari-noi.ro/index.php?page=movie_details&act=1&id=7493",
+ 2008,
+ 4230,
+ True,
+ 1,
+ )
+
+
[email protected]("comment", ["season 01", "Sezonul 1 ep. 1-7", "S01"])
+def test_subtitle_get_matches_episode(subtitrari_subtitle, episodes, comment):
+ episode = episodes["breaking_bad_s01e01"]
+ episode.episode = 1
+ subtitrari_subtitle.comments = comment
+ assert {"season", "episode", "series", "imdb_id"}.issubset(
+ subtitrari_subtitle.get_matches(episode)
+ )
+
+
[email protected]("comment", ["season 02", "Sezonul 2 ep. 1-7", "version 01"])
+def test_subtitle_get_matches_episode_false(subtitrari_subtitle, episodes, comment):
+ episode = episodes["breaking_bad_s01e01"]
+ episode.episode = 1
+ subtitrari_subtitle.comments = comment
+ assert not {"season", "episode"}.issubset(subtitrari_subtitle.get_matches(episode))
+
+
+def test_provider_download_subtitle(subtitrari_subtitle):
+ with SubtitrarinoiProvider() as provider:
+ provider.download_subtitle(subtitrari_subtitle)
+ assert subtitrari_subtitle.is_valid()