From 7cf15efb748ef5c044906cfbe9b3baef6aa787be Mon Sep 17 00:00:00 2001 From: getzze Date: Mon, 23 Sep 2024 22:22:09 +0100 Subject: [PATCH] update tests --- tests/providers/test_bsplayer.py | 9 +++++++++ tests/providers/test_napiprojekt.py | 4 ++++ tests/refiners/test_hash.py | 20 +------------------- 3 files changed, 14 insertions(+), 19 deletions(-) diff --git a/tests/providers/test_bsplayer.py b/tests/providers/test_bsplayer.py index 3b044884..961dbf98 100644 --- a/tests/providers/test_bsplayer.py +++ b/tests/providers/test_bsplayer.py @@ -16,6 +16,15 @@ SEARCH_URL = 'http://s1.api.bsplayer-subtitles.com/v1.php' +def test_hash_bsplayer(mkv): + assert BSPlayerProvider.hash_video(mkv['test1']) == '40b44a7096b71ec3' + + +def test_hash_bsplayer_too_small(tmpdir): + path = tmpdir.ensure('test_too_small.mkv') + assert BSPlayerProvider.hash_video(str(path)) is None + + def test_get_matches_movie_hash(episodes): subtitle = BSPlayerSubtitle( subtitle_id='16442520', diff --git a/tests/providers/test_napiprojekt.py b/tests/providers/test_napiprojekt.py index c12bfea0..4d65fe33 100644 --- a/tests/providers/test_napiprojekt.py +++ b/tests/providers/test_napiprojekt.py @@ -13,6 +13,10 @@ ) +def test_hash_napiprojekt(mkv): + assert NapiProjektProvider.hash_video(mkv['test1']) == '9884a2b66dcb2965d0f45ce84e37b60c' + + def test_get_matches(movies): subtitle = NapiProjektSubtitle(Language('pol'), '6303e7ee6a835e9fcede9fb2fb00cb36') matches = subtitle.get_matches(movies['man_of_steel']) diff --git a/tests/refiners/test_hash.py b/tests/refiners/test_hash.py index 047ab437..62f0e1e6 100644 --- a/tests/refiners/test_hash.py +++ b/tests/refiners/test_hash.py @@ -1,13 +1,4 @@ -from subliminal.refiners.hash import hash_bsplayer, hash_opensubtitles, hash_thesubdb - - -def test_hash_bsplayer(mkv): - assert hash_bsplayer(mkv['test1']) == '40b44a7096b71ec3' - - -def test_hash_bsplayer_too_small(tmpdir): - path = tmpdir.ensure('test_too_small.mkv') - assert hash_bsplayer(str(path)) is None +from subliminal.refiners.hash import hash_opensubtitles def test_hash_opensubtitles(mkv): @@ -17,12 +8,3 @@ def test_hash_opensubtitles(mkv): def test_hash_opensubtitles_too_small(tmpdir): path = tmpdir.ensure('test_too_small.mkv') assert hash_opensubtitles(str(path)) is None - - -def test_hash_thesubdb(mkv): - assert hash_thesubdb(mkv['test1']) == '054e667e93e254f8fa9f9e8e6d4e73ff' - - -def test_hash_thesubdb_too_small(tmpdir): - path = tmpdir.ensure('test_too_small.mkv') - assert hash_thesubdb(str(path)) is None