diff --git a/tests/api/test_media.py b/tests/api/test_media.py index dab5380..142ca80 100644 --- a/tests/api/test_media.py +++ b/tests/api/test_media.py @@ -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)