1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-25 04:02:32 +01:00

skip tests on 5xx status codes

This commit is contained in:
Mike Fährmann 2017-11-12 20:51:12 +01:00
parent 7e7b64162b
commit 2457b71633
No known key found for this signature in database
GPG Key ID: 5680CA389D365A88

View File

@ -9,7 +9,7 @@
import sys
import unittest
from gallery_dl import extractor, job, config
from gallery_dl import extractor, job, config, exception
class TestExtractors(unittest.TestCase):
@ -45,7 +45,16 @@ class TestExtractors(unittest.TestCase):
self.assertRaises(result["exception"], tjob.run)
return
tjob.run()
try:
tjob.run()
except exception.HttpError as exc:
try:
if 500 <= exc.args[0].response.status_code < 600:
self.skipTest(exc)
except AttributeError as e:
pass
raise
if "url" in result:
self.assertEqual(result["url"], tjob.hash_url.hexdigest())
if "keyword" in result:
@ -73,7 +82,6 @@ skip = [
"exhentai", "kissmanga", "mangafox", "dynastyscans", "nijie",
"archivedmoe", "archiveofsins", "thebarchive",
# temporary issues
"nyafuu",
"mangazuki",
]
# enable selective testing for direct calls