Limit comic tests for now.
This commit is contained in:
parent
a7036beef7
commit
7b2c839f03
1 changed files with 7 additions and 7 deletions
|
@ -3,7 +3,7 @@
|
||||||
# Copyright (C) 2012 Bastian Kleineidam
|
# Copyright (C) 2012 Bastian Kleineidam
|
||||||
import tempfile
|
import tempfile
|
||||||
import shutil
|
import shutil
|
||||||
from itertools import izip
|
from itertools import islice
|
||||||
from unittest import TestCase
|
from unittest import TestCase
|
||||||
from dosagelib import scraper
|
from dosagelib import scraper
|
||||||
|
|
||||||
|
@ -21,8 +21,8 @@ class _ComicTester(TestCase):
|
||||||
# on at least 4 pages.
|
# on at least 4 pages.
|
||||||
scraperobj = self.scraperclass()
|
scraperobj = self.scraperclass()
|
||||||
num = empty = 0
|
num = empty = 0
|
||||||
for n, strip in izip(xrange(5), scraperobj.getAllStrips()):
|
for strip in islice(scraperobj.getAllStrips(), 0, 5):
|
||||||
images = strips.getImages()
|
images = strip.getImages()
|
||||||
if len(images) == 0:
|
if len(images) == 0:
|
||||||
empty += 1
|
empty += 1
|
||||||
for image in images:
|
for image in images:
|
||||||
|
@ -46,10 +46,10 @@ class _ComicTester(TestCase):
|
||||||
|
|
||||||
|
|
||||||
def generate_comic_testers():
|
def generate_comic_testers():
|
||||||
"""For each comic scraper, create a test class.
|
"""For each comic scraper, create a test class."""
|
||||||
This currently generates over 4000 test classes (one for each comic),
|
# Limit number of scraper tests for now
|
||||||
so this takes a while."""
|
max_scrapers = 10
|
||||||
for scraperclass in scraper.get_scrapers():
|
for scraperclass in islice(scraper.get_scrapers(), 0, max_scrapers):
|
||||||
name = 'Test'+scraperclass.__name__
|
name = 'Test'+scraperclass.__name__
|
||||||
globals()[name] = type(name,
|
globals()[name] = type(name,
|
||||||
(_ComicTester,),
|
(_ComicTester,),
|
||||||
|
|
Loading…
Reference in a new issue