diff options
author | Vitiko <[email protected]> | 2023-03-03 15:51:38 -0400 |
---|---|---|
committer | Vitiko <[email protected]> | 2023-03-03 15:51:38 -0400 |
commit | ad13f79d193d479b0c674a05330b97befc8445c7 (patch) | |
tree | 0c8a4102c03dcdb4c131937d25fcee6f520368e2 /tests | |
parent | 248e49de76c4a94e9dc6db9166521b8527f476bc (diff) | |
download | bazarr-ad13f79d193d479b0c674a05330b97befc8445c7.tar.gz bazarr-ad13f79d193d479b0c674a05330b97befc8445c7.zip |
Subf2m Provider: improve episode matching (#2081)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/subliminal_patch/test_subf2m.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/subliminal_patch/test_subf2m.py b/tests/subliminal_patch/test_subf2m.py index 47a823bfc..19275d48a 100644 --- a/tests/subliminal_patch/test_subf2m.py +++ b/tests/subliminal_patch/test_subf2m.py @@ -1,5 +1,5 @@ import pytest - +from subliminal_patch.providers import subf2m from subliminal_patch.providers.subf2m import Subf2mProvider from subliminal_patch.providers.subf2m import Subf2mSubtitle from subzero.language import Language @@ -188,3 +188,17 @@ def test_download_subtitle_episode_with_title(): with Subf2mProvider() as provider: provider.download_subtitle(sub) assert sub.is_valid() + + +def test_get_episode_from_release(): + assert subf2m._get_episode_from_release( + "Vinland Saga Season 2 - 05 [Crunchyroll][Crunchyroll] Vinland Saga Season 2 - 05" + ) == {"season": [2], "episode": [5]} + + +def test_get_episode_from_release_return_none(): + assert subf2m._get_episode_from_release("Vinland Saga Season 2 - Foo") is None + + +def test_get_episode_from_release_w_empty_match_return_none(): + assert subf2m._get_episode_from_release("Vinland Saga - 02") is None |