Parametrize renamed comic module test
This commit is contained in:
parent
32b0dfef35
commit
cfe5738151
1 changed files with 12 additions and 9 deletions
|
@ -3,12 +3,15 @@
|
||||||
# Copyright (C) 2012-2014 Bastian Kleineidam
|
# Copyright (C) 2012-2014 Bastian Kleineidam
|
||||||
# Copyright (C) 2015-2022 Tobias Gruetzmacher
|
# Copyright (C) 2015-2022 Tobias Gruetzmacher
|
||||||
import re
|
import re
|
||||||
|
from operator import attrgetter
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
from dosagelib.scraper import scrapers
|
from dosagelib.scraper import scrapers
|
||||||
from dosagelib.plugins import old
|
from dosagelib.plugins import old
|
||||||
|
|
||||||
|
|
||||||
class TestComicNames(object):
|
class TestComicNames:
|
||||||
|
|
||||||
def test_names(self):
|
def test_names(self):
|
||||||
for scraperobj in scrapers.all():
|
for scraperobj in scrapers.all():
|
||||||
|
@ -20,11 +23,11 @@ class TestComicNames(object):
|
||||||
comicname = name
|
comicname = name
|
||||||
assert re.sub("[^0-9a-zA-Z_]", "", comicname) == comicname
|
assert re.sub("[^0-9a-zA-Z_]", "", comicname) == comicname
|
||||||
|
|
||||||
def test_renamed(self):
|
@pytest.mark.parametrize(('scraperobj'),
|
||||||
for scraperobj in scrapers.all(include_removed=True):
|
[obj for obj in scrapers.all(include_removed=True)
|
||||||
if not isinstance(scraperobj, old.Renamed):
|
if isinstance(obj, old.Renamed)], ids=attrgetter('name'))
|
||||||
continue
|
def test_renamed(self, scraperobj):
|
||||||
assert len(scraperobj.getDisabledReasons()) > 0
|
assert len(scraperobj.getDisabledReasons()) > 0
|
||||||
# Renamed scraper should only point to an non-disabled scraper
|
# Renamed scraper should only point to an non-disabled scraper
|
||||||
newscraper = scrapers.find(scraperobj.newname)
|
newscraper = scrapers.find(scraperobj.newname)
|
||||||
assert len(newscraper.getDisabledReasons()) == 0
|
assert len(newscraper.getDisabledReasons()) == 0
|
||||||
|
|
Loading…
Reference in a new issue