dosage/tests/test_comicnames.py

23 lines
703 B
Python
Raw Normal View History

2012-12-12 16:41:29 +00:00
# -*- coding: iso-8859-1 -*-
2013-02-15 17:32:36 +00:00
# Copyright (C) 2012-2013 Bastian Kleineidam
2012-12-12 16:41:29 +00:00
from unittest import TestCase
from dosagelib import scraper, util
2013-04-29 05:35:56 +00:00
try:
text_type = unicode
except NameError:
text_type = str
2012-12-12 16:41:29 +00:00
class TestComicNames(TestCase):
def test_names(self):
for scraperclass in scraper.get_scraperclasses():
name = scraperclass.getName()
2012-12-12 16:41:29 +00:00
self.assertTrue(name.count('/') <= 1, name)
if '/' in name:
comicname = name.split('/')[1]
else:
comicname = name
self.assertEqual(util.asciify(comicname), comicname)
2013-04-29 05:35:56 +00:00
self.assertTrue(isinstance(scraperclass.description, text_type), comicname)