Add a test to ckeck that renamed comics point to existing comics

This commit is contained in:
Tobias Gruetzmacher 2019-12-29 20:50:56 +01:00
parent e1f712d194
commit d0bc0572c2
2 changed files with 13 additions and 3 deletions

View file

@ -222,10 +222,12 @@ class Removed(Scraper):
cls('GoComics/AdventuresofMartyandTurkey'),
cls('GoComics/AdventuresofMikeAndSimon'),
cls('GoComics/AgentGates'),
cls('GoComics/AlisonWard'),
cls('GoComics/AmaZnEvents'),
cls('GoComics/AnythingGoes'),
cls('GoComics/BCEnEspaol'),
cls('GoComics/BenAndSeymour'),
cls('GoComics/BeneaththeFerns'),
cls('GoComics/BenSargent'),
cls('GoComics/BERSERKALERT'),
cls('GoComics/BestInShow'),
@ -604,14 +606,12 @@ class Renamed(Scraper):
cls('FoulLanguage', 'GoComics/FowlLanguage'),
cls('GoComics/060', 'ComicSherpa/060'),
cls('GoComics/ABitSketch', 'ComicSherpa/ABitSketch'),
cls('GoComics/AlisonWard', 'ComicSherpa/AlisonWard'),
cls('GoComics/Andnow', 'ComicSherpa/AndNow'),
cls('GoComics/Anecdote', 'ComicSherpa/Anecdote'),
cls('GoComics/AppleCreekComics', 'ComicSherpa/AppleCreekComics'),
cls('GoComics/BarkingCrayon', 'ComicFury/BarkingCrayon'),
cls('GoComics/BatchRejection', 'ComicSherpa/BatchRejection'),
cls('GoComics/Bazoobee', 'ComicSherpa/Bazoobee'),
cls('GoComics/BeneaththeFerns', 'ComicSherpa/BeneathTheFerns'),
cls('GoComics/Bluebonnets', 'ComicSherpa/Bluebonnets'),
cls('GoComics/BlueSkiesToons', 'ComicSherpa/BlueSkiesToons'),
cls('GoComics/BottAuto', 'ComicSherpa/BottAuto'),

View file

@ -1,13 +1,14 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs
# Copyright (C) 2012-2014 Bastian Kleineidam
# Copyright (C) 2015-2017 Tobias Gruetzmacher
# Copyright (C) 2015-2019 Tobias Gruetzmacher
from __future__ import absolute_import, division, print_function
import re
from dosagelib import scraper
from dosagelib.plugins import old
class TestComicNames(object):
@ -21,3 +22,12 @@ class TestComicNames(object):
else:
comicname = name
assert re.sub("[^0-9a-zA-Z_]", "", comicname) == comicname
def test_renamed(self):
for scraperobj in scraper.get_scrapers(include_removed=True):
if not isinstance(scraperobj, old.Renamed):
continue
assert len(scraperobj.getDisabledReasons()) > 0
# Renamed scraper should only point to an non-disabled scraper
newscraper = scraper.find_scrapers(scraperobj.newname)[0]
assert len(newscraper.getDisabledReasons()) == 0