示例#1
0
 def test_renamed(self):
     for scraperobj in scrapers.get(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 = scrapers.find(scraperobj.newname)[0]
         assert len(newscraper.getDisabledReasons()) == 0
示例#2
0
 def test_user_dir(self):
     oldlen = len(scrapers.get())
     scrapers.adddir(Path(__file__).parent / 'mocks' / 'extra')
     assert len(scrapers.get()) == oldlen + 1
     assert len(scrapers.find('AnotherDummyTestScraper')) == 1
示例#3
0
 def test_find_scrapers_multi(self):
     result = scrapers.find("a", multiple_allowed=True)
     assert len(result) > 1
示例#4
0
 def test_find_scrapers_error(self):
     with pytest.raises(ValueError, match='empty comic name'):
         scrapers.find('')
示例#5
0
 def test_find_scrapers_single(self):
     result = scrapers.find("xkcd")
     assert len(result) == 1