# -*- coding: iso-8859-1 -*-
# Copyright (C) 2013 Bastian Kleineidam
from unittest import TestCase
from dosagelib import scraper


class ScraperTester(TestCase):
    """Test scraper module functions."""

    def test_get_scraperclasses(self):
        for scraperclass in scraper.get_scraperclasses():
            scraperclass()
            scraperclass(indexes=["bla"])

    def test_find_scraperclasses_single(self):
        result = scraper.find_scraperclasses("CalvinAndHobbes")
        self.assertEqual(len(result), 1)

    def test_find_scraperclasses_multi(self):
        result = scraper.find_scraperclasses("a", multiple_allowed=True)
        self.assertTrue(len(result) > 1)

    def test_find_scraperclasses_error(self):
        self.assertRaises(ValueError, scraper.find_scraperclasses, "")

@@ -297,32 +297,45 @@
 s():%0A           
+ scraperobj =
  scraperclass()%0A
@@ -337,32 +337,45 @@
 ss()%0A           
+ scraperobj =
  scraperclass(in
@@ -388,16 +388,120 @@
 %5B%22bla%22%5D)
+%0A            self.assertTrue(scraperobj.url,%0A                %22missing url in %25s%22 %25 scraperobj.getName())
 %0A%0A    de

Test for URL in every scraper.