Fix empty image list test.

This commit is contained in:
Bastian Kleineidam 2012-10-11 15:17:01 +02:00
parent 7b2c839f03
commit 9346ca997d

View file

@ -22,11 +22,12 @@ class _ComicTester(TestCase):
scraperobj = self.scraperclass() scraperobj = self.scraperclass()
num = empty = 0 num = empty = 0
for strip in islice(scraperobj.getAllStrips(), 0, 5): for strip in islice(scraperobj.getAllStrips(), 0, 5):
images = strip.getImages() images = 0
if len(images) == 0: for image in strip.getImages():
empty += 1 images += 1
for image in images:
self.save(image) self.save(image)
if not images:
empty += 1
num += 1 num += 1
self.check(num >= 4, 'traversal failed after %d strips.' % num) self.check(num >= 4, 'traversal failed after %d strips.' % num)
self.check(empty <= 1, 'failed to find images on %d pages.' % empty) self.check(empty <= 1, 'failed to find images on %d pages.' % empty)