[test:results] add support for "range" options in tests
This commit is contained in:
@@ -14,7 +14,7 @@ import unittest
|
|||||||
from gallery_dl import extractor, job, config, exception
|
from gallery_dl import extractor, job, config, exception
|
||||||
|
|
||||||
|
|
||||||
# these don't work on travis-ci
|
# these don't work on Travis CI
|
||||||
TRAVIS_SKIP = {
|
TRAVIS_SKIP = {
|
||||||
"exhentai", "kissmanga", "mangafox", "dynastyscans", "nijie",
|
"exhentai", "kissmanga", "mangafox", "dynastyscans", "nijie",
|
||||||
"archivedmoe", "archiveofsins", "thebarchive", "fireden",
|
"archivedmoe", "archiveofsins", "thebarchive", "fireden",
|
||||||
@@ -23,8 +23,9 @@ TRAVIS_SKIP = {
|
|||||||
|
|
||||||
# temporary issues, etc.
|
# temporary issues, etc.
|
||||||
BROKEN = {
|
BROKEN = {
|
||||||
"imagefap", # gallery flagged and unavailable
|
"desuarchive", # down
|
||||||
"rbt", # cert expired
|
"imagefap", # gallery flagged and unavailable
|
||||||
|
"rbt", # down
|
||||||
"subapics",
|
"subapics",
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,6 +56,8 @@ class TestExtractorResults(unittest.TestCase):
|
|||||||
if "options" in result:
|
if "options" in result:
|
||||||
for key, value in result["options"]:
|
for key, value in result["options"]:
|
||||||
config.set(key.split("."), value)
|
config.set(key.split("."), value)
|
||||||
|
if "range" in result:
|
||||||
|
config.set(("_", "image", "range"), (result["range"],))
|
||||||
content = "content" in result
|
content = "content" in result
|
||||||
else:
|
else:
|
||||||
content = False
|
content = False
|
||||||
@@ -67,9 +70,10 @@ class TestExtractorResults(unittest.TestCase):
|
|||||||
if "exception" in result:
|
if "exception" in result:
|
||||||
self.assertRaises(result["exception"], tjob.run)
|
self.assertRaises(result["exception"], tjob.run)
|
||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
tjob.run()
|
tjob.run()
|
||||||
|
except exception.StopExtraction:
|
||||||
|
pass
|
||||||
except exception.HttpError as exc:
|
except exception.HttpError as exc:
|
||||||
if re.match(r"5\d\d HTTP Error:", str(exc)):
|
if re.match(r"5\d\d HTTP Error:", str(exc)):
|
||||||
self.skipTest(exc)
|
self.skipTest(exc)
|
||||||
|
|||||||
Reference in New Issue
Block a user