fix extractor names

This commit is contained in:
Mike Fährmann
2018-04-18 18:06:30 +02:00
parent b1325d4d2c
commit 10cc59f3b5
3 changed files with 25 additions and 1 deletions

View File

@@ -144,6 +144,29 @@ class TestExtractor(unittest.TestCase):
"{} <-> {}".format(extr1, extr2),
)
def test_names(self):
"""Ensure extractor classes are named CategorySubcategoryExtractor"""
mapping = {
"2chan" : "futaba",
"3dbooru": "threedeebooru",
"4chan" : "fourchan",
"4plebs" : "fourplebs",
"8chan" : "infinitychan",
"b4k" : "bfourk",
"oauth" : None,
"rbt" : "rebeccablacktech",
"whatisthisimnotgoodwithcomputers": "witingwc",
}
for extr in extractor.extractors():
category = mapping.get(extr.category, extr.category)
if category:
expected = "{}{}Extractor".format(
category.capitalize(),
extr.subcategory.capitalize(),
)
self.assertEqual(expected, extr.__name__)
if __name__ == "__main__":
unittest.main()

View File

@@ -21,6 +21,7 @@ TRAVIS_SKIP = {
# temporary issues, etc.
BROKEN = {
"gomanga", # server down
"pinterest", # access tokens have been set to 10 requests per hour
"puremashiro", # online reader down
}