forked from moehmeni/syncedlyrics
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.py
53 lines (34 loc) · 1.12 KB
/
tests.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
"""Some simple tests for geting notifed for API changes of the providers"""
import os
import syncedlyrics
import logging
logging.basicConfig(level=logging.DEBUG)
q = os.getenv("TEST_Q", "bad guy billie eilish")
def _test_provider(provider: str, **kwargs):
lrc = syncedlyrics.search(
search_term=q, allow_plain_format=True, providers=[provider], **kwargs
)
logging.debug(lrc)
assert isinstance(lrc, str)
return lrc
def test_netease():
_test_provider("NetEase")
def test_musixmatch():
_test_provider("Musixmatch")
def test_musixmatch_translation():
lrc = _test_provider("Musixmatch", lang="es")
# not only testing there is a result, but the translation is also included
assert syncedlyrics.utils.has_translation(lrc)
def test_musixmatch_enhanced():
_test_provider("Musixmatch", enhanced=True)
def test_lrclib():
_test_provider("Lrclib")
# Not working (at least temporarily)
# def test_deezer():
# _test_provider("Deezer")
# Fails randomly on CI
# def test_megalobiz():
# _test_provider("Megalobiz")
# TODO: fix
# def test_genius():
# _test_provider("Genius")