Ejemplo n.º 1
0
 def test_page_count(self):
     w = WebSite(None, None)
     w.domainBase = "google.com"
     w.max_page_count = 2
     w.get_urls(WEB_SITE)
     self.assertEqual(w.max_page_count, 0)
     self.assertEqual(len(w.toProcess), 2)
Ejemplo n.º 2
0
 def test_find_urls(self):
     sites = ["http://www.google.com/help",
              "http://www.google.com/mail",
              "https://mail.google.com"]
     w = WebSite(None, None)
     w.domainBase = "google.com"
     w.max_page_count=10
     w.get_urls(WEB_SITE)
     for site in sites:
         self.assertTrue(site in w.toProcess)
     self.assertTrue(w is not None)
Ejemplo n.º 3
0
 def test_url_parsing_from_config(self):
     w = WebSite(None, Configuration(DOMAIN_BASE = "google.com",
                       MAX_PAGE_COUNT = 10))
     w.get_urls(WEB_SITE)
     self.assertEqual(w.max_page_count, 6)
     self.assertEqual(len(w.toProcess) + len(w.processed), 4)