Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
getzze committed Sep 23, 2024
1 parent b6adb05 commit 7cf15ef
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 19 deletions.
9 changes: 9 additions & 0 deletions tests/providers/test_bsplayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 4 additions & 0 deletions tests/providers/test_napiprojekt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'])
Expand Down
20 changes: 1 addition & 19 deletions tests/refiners/test_hash.py
Original file line number Diff line number Diff line change
@@ -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):
Expand All @@ -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

0 comments on commit 7cf15ef

Please sign in to comment.