allow 'only_matching' tests
This commit is contained in:
@@ -174,7 +174,6 @@ class FlickrGroupExtractor(FlickrExtractor):
|
||||
pattern = [r"(?:https?://)?(?:www\.)?flickr\.com/groups/([^/]+)"]
|
||||
test = [("https://www.flickr.com/groups/bird_headshots/", {
|
||||
"url": "40b5586fa0cd1578c3b8cc874fc6e3ae7af70786",
|
||||
"keyword": "cd056422203e0a6cae93cd866a6ee0920cebb3be",
|
||||
})]
|
||||
|
||||
def data(self):
|
||||
@@ -217,11 +216,11 @@ class FlickrSearchExtractor(FlickrExtractor):
|
||||
subcategory = "search"
|
||||
directory_fmt = ["{category}", "{subcategory}", "{search[text]}"]
|
||||
pattern = [r"(?:https?://)?(?:www\.)?flickr\.com/search/?\?([^#]+)"]
|
||||
test = [(("https://flickr.com/search/?text=tree%20cloud%20house"
|
||||
"&color_codes=4&styles=minimalism"), {
|
||||
"url": "ba7ca5a0da857775f68ab63ff5653bf4b16f2ceb",
|
||||
"keyword": "20cd3b153f52ec88e949d1167439583461a515b3",
|
||||
})]
|
||||
test = [
|
||||
(("https://flickr.com/search/?text=mountain"), None),
|
||||
(("https://flickr.com/search/?text=tree%20cloud%20house"
|
||||
"&color_codes=4&styles=minimalism"), None),
|
||||
]
|
||||
|
||||
def __init__(self, match):
|
||||
FlickrExtractor.__init__(self, match)
|
||||
|
||||
@@ -39,17 +39,14 @@ class MangaparkChapterExtractor(Extractor):
|
||||
r"([^/]+/s(\d+)(?:/v([^/]+))?/c(\d+)(?:([^/]+)|/e(\d+))?)")]
|
||||
test = [
|
||||
("http://mangapark.me/manga/gosu/s2/c55", {
|
||||
"url": "fefe84492d9118de5962563fbecb9362051c52d5",
|
||||
"keyword": "652b38c40bdfb5592456b6e7524a3acfdef9fae6",
|
||||
"keyword": "bd97ca24ef344b44292910384215ef3f1005ea2e",
|
||||
}),
|
||||
(("http://mangapark.me/manga/"
|
||||
"ad-astra-per-aspera-hata-kenjirou/s1/c1.2"), {
|
||||
"url": "64b47f9837d50c3e57793ff6703d840ef7808c52",
|
||||
"keyword": "f28eb26b4966bebda0e761f241c2dd49e505ce13",
|
||||
"keyword": "6e56986610cb2da9917d0d9d3217d700fbc48665",
|
||||
}),
|
||||
("http://mangapark.me/manga/gekkan-shoujo-nozaki-kun/s2/c70/e2/1", {
|
||||
"url": "f8915e25895d4b336892f8a6bd27d26cdb337045",
|
||||
"keyword": "34aa6ca3bdf5078f839cbf68ff68e39728cf248b",
|
||||
"keyword": "46a332caa65ef646c9405f69947c27f0dbc5430e",
|
||||
})
|
||||
]
|
||||
|
||||
|
||||
@@ -24,8 +24,11 @@ class TestExtractors(unittest.TestCase):
|
||||
config.set(("extractor", "seiga", "username"), email)
|
||||
|
||||
def _run_test(self, extr, url, result):
|
||||
tjob = job.TestJob(url, "content" in result)
|
||||
content = "content" in result if result else False
|
||||
tjob = job.TestJob(url, content)
|
||||
self.assertEqual(extr, tjob.extractor.__class__)
|
||||
if not result:
|
||||
return
|
||||
if "exception" in result:
|
||||
self.assertRaises(result["exception"], tjob.run)
|
||||
return
|
||||
@@ -51,7 +54,7 @@ skip = [
|
||||
# dont work on travis-ci
|
||||
"exhentai", "kissmanga", "mangafox", "dynastyscans", "nijie",
|
||||
# temporary issues
|
||||
"gomanga", "mangapark",
|
||||
"imagefap"
|
||||
]
|
||||
# enable selective testing for direct calls
|
||||
if __name__ == '__main__' and len(sys.argv) > 1:
|
||||
|
||||
Reference in New Issue
Block a user