From 65997d835b62116ab4b46a2a4134707fd82db060 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 31 Aug 2017 15:09:18 +0200 Subject: [PATCH] replace popular/ranking tests with older ones Metadata of several year old lists shouldn't change as much as it would for newer ones, which makes metadata-comparisons of the output of build_testresult_db.oy easier. --- gallery_dl/extractor/3dbooru.py | 4 ++-- gallery_dl/extractor/danbooru.py | 2 +- gallery_dl/extractor/e621.py | 3 +-- gallery_dl/extractor/konachan.py | 2 +- gallery_dl/extractor/yandere.py | 2 +- test/test_extractors.py | 7 ++++--- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gallery_dl/extractor/3dbooru.py b/gallery_dl/extractor/3dbooru.py index 33fd37d1..9d378641 100644 --- a/gallery_dl/extractor/3dbooru.py +++ b/gallery_dl/extractor/3dbooru.py @@ -57,8 +57,8 @@ class ThreedeebooruPopularExtractor(ThreedeebooruExtractor, """Extractor for popular images from behoimi.org""" pattern = [r"(?:https?://)?(?:www\.)?behoimi\.org/post/popular_" r"(by_(?:day|week|month)|recent)(?:\?([^#]*))?"] - test = [("http://behoimi.org/post/popular_by_month?month=6&year=2017", { - "url": "d2f8b04e54b12b8daaa4ba5fbea84d7dabe8a5df", + test = [("http://behoimi.org/post/popular_by_month?month=2&year=2013", { + "url": "dfe779d6e6336bd8f67078483bc14b2af1a5aee8", "count": 20, })] diff --git a/gallery_dl/extractor/danbooru.py b/gallery_dl/extractor/danbooru.py index a051f2c2..9e44d789 100644 --- a/gallery_dl/extractor/danbooru.py +++ b/gallery_dl/extractor/danbooru.py @@ -49,7 +49,7 @@ class DanbooruPopularExtractor(DanbooruExtractor, booru.BooruPopularExtractor): test = [ ("https://danbooru.donmai.us/explore/posts/popular", None), (("https://danbooru.donmai.us/explore/posts/popular" - "?date=2017-07-17+14%3A13%3A05+-0400&scale=week"), { + "?date=2013-06-06+03%3A34%3A22+-0400&scale=week"), { "count": 20, }), ] diff --git a/gallery_dl/extractor/e621.py b/gallery_dl/extractor/e621.py index 4642b806..e786d594 100644 --- a/gallery_dl/extractor/e621.py +++ b/gallery_dl/extractor/e621.py @@ -51,8 +51,7 @@ class E621PopularExtractor(E621Extractor, booru.BooruPopularExtractor): """Extractor for popular images from 621.net""" pattern = [r"(?:https?://)?(?:www\.)?e621\.net/post/popular_by_" r"(day|week|month)(?:\?([^#]*))?"] - test = [("https://e621.net/post/popular_by_month?month=6&year=2017", { - "url": "e09aba8e7f2026e7925e7f7b74c1ea9da2a1682d", + test = [("https://e621.net/post/popular_by_month?month=6&year=2013", { "count": 32, })] diff --git a/gallery_dl/extractor/konachan.py b/gallery_dl/extractor/konachan.py index 506664cc..cdcdd7db 100644 --- a/gallery_dl/extractor/konachan.py +++ b/gallery_dl/extractor/konachan.py @@ -45,7 +45,7 @@ class KonachanPopularExtractor(KonachanExtractor, booru.BooruPopularExtractor): """Extractor for popular images from konachan.com""" pattern = [r"(?:https?://)?(?:www\.)?konachan\.com/post/popular_" r"(by_(?:day|week|month)|recent)(?:\?([^#]*))?"] - test = [("https://konachan.com/post/popular_by_month?month=11&year=2016", { + test = [("https://konachan.com/post/popular_by_month?month=11&year=2010", { "count": 20, })] diff --git a/gallery_dl/extractor/yandere.py b/gallery_dl/extractor/yandere.py index 6ec2f236..d1d541e7 100644 --- a/gallery_dl/extractor/yandere.py +++ b/gallery_dl/extractor/yandere.py @@ -46,7 +46,7 @@ class YanderePopularExtractor(YandereExtractor, booru.BooruPopularExtractor): pattern = [r"(?:https?://)?(?:www\.)?yande\.re/post/popular_" r"(by_(?:day|week|month)|recent)(?:\?([^#]*))?"] test = [ - ("https://yande.re/post/popular_by_day?day=20&month=8&year=2017", { + ("https://yande.re/post/popular_by_month?month=6&year=2014", { "count": 40, }), ("https://yande.re/post/popular_recent", None), diff --git a/test/test_extractors.py b/test/test_extractors.py index 637587ac..db4e2f01 100644 --- a/test/test_extractors.py +++ b/test/test_extractors.py @@ -32,6 +32,9 @@ class TestExtractors(unittest.TestCase): self.assertEqual(extr, tjob.extractor.__class__) if not result: return + if "options" in result: + for key, value in result["options"]: + config.set(key, value) if "exception" in result: self.assertRaises(result["exception"], tjob.run) return @@ -63,9 +66,7 @@ skip = [ "exhentai", "kissmanga", "mangafox", "dynastyscans", "nijie", "archivedmoe", "archiveofsins", "thebarchive", # temporary issues - "imgtrex", # 504 - "e621", - "3dbooru", + "luscious", # ssl cert issues ] # enable selective testing for direct calls if __name__ == '__main__' and len(sys.argv) > 1: