mirror of
https://github.com/spl0k/supysonic.git
synced 2024-12-22 08:56:17 +00:00
Skip lyrics tests if ChartLyrics is down
This commit is contained in:
parent
25c5c8277e
commit
7cfd958eeb
@ -9,6 +9,7 @@
|
||||
# Distributed under terms of the GNU AGPLv3 license.
|
||||
|
||||
import os.path
|
||||
import requests
|
||||
import uuid
|
||||
|
||||
from io import BytesIO
|
||||
@ -158,6 +159,12 @@ class MediaTestCase(ApiTestBase):
|
||||
self._make_request('getLyrics', { 'artist': 'artist' }, error = 10)
|
||||
self._make_request('getLyrics', { 'title': 'title' }, error = 10)
|
||||
|
||||
# Potentially skip the tests if ChartLyrics is down (which happens quite often)
|
||||
try:
|
||||
requests.get('http://api.chartlyrics.com/', timeout = 5)
|
||||
except requests.exceptions.Timeout:
|
||||
self.skipTest('ChartLyrics down')
|
||||
|
||||
rv, child = self._make_request('getLyrics', { 'artist': 'some really long name hoping', 'title': 'to get absolutely no result' }, tag = 'lyrics')
|
||||
self.assertIsNone(child.text)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user