summaryrefslogtreecommitdiffhomepage
path: root/tests/subliminal_patch/test_subtitle.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/subliminal_patch/test_subtitle.py')
-rw-r--r--tests/subliminal_patch/test_subtitle.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/subliminal_patch/test_subtitle.py b/tests/subliminal_patch/test_subtitle.py
new file mode 100644
index 000000000..f0c7dabcf
--- /dev/null
+++ b/tests/subliminal_patch/test_subtitle.py
@@ -0,0 +1,29 @@
+from subliminal_patch import subtitle
+
+
+def test_guess_matches_w_edition_only_video(movies):
+ movie = movies["dune"]
+ movie.edition = "Director's Cut"
+ matches = subtitle.guess_matches(movie, {})
+ assert "edition" not in matches
+
+
+def test_guess_matches_w_edition_only_guess(movies):
+ movie = movies["dune"]
+ movie.edition = None
+ matches = subtitle.guess_matches(movie, {"edition": "Director's Cut"})
+ assert "edition" not in matches
+
+
+def test_guess_matches_w_edition_both(movies):
+ movie = movies["dune"]
+ movie.edition = "Director's Cut"
+ matches = subtitle.guess_matches(movie, {"edition": "Director's Cut"})
+ assert "edition" in matches
+
+
+def test_guess_matches_w_edition_both_empty(movies):
+ movie = movies["dune"]
+ movie.edition = None
+ matches = subtitle.guess_matches(movie, {})
+ assert "edition" in matches