Example #1
0
 def test_zip_files(self):
     base_url = "http://yoyowallet.com/assets.html"
     links, assets = parse_html(base_url, read_data("yoyo_assets.html"))
     self.assertNotIn("http://yoyowallet.com/downloads/founders.zip", links)
     self.assertNotIn("http://yoyowallet.com/downloads/logos.zip", links)
     self.assertNotIn("http://yoyowallet.com/downloads/screenshots.zip",
                      links)
Example #2
0
 def test_yoyo_get_links_func(self):
     html_doc = read_data("yoyowallet.html")
     links = parse_html('http://yoyowallet.com', html_doc)[0]
     self.assertEqual(links[0], "http://blog.yoyowallet.com")
     self.assertEqual(
         links[11],
         "https://support.yoyowallet.com/hc/en-gb/categories/201132913-Legal-and-T-Cs"
     )
Example #3
0
 def test_py_get_asserts_by_func(self):
     assets = parse_html(self.py_url, self.py_file)[1]
     # print("\n".join(assets))
     # for asset in assets:
     #     print(get_tld(asset, fail_silently=True), asset)
     self.assertIsNotNone(assets)
     self.assertEqual(len(assets), 134)
     self.assertEqual(assets[0], "http://blog.python.org")
     self.assertEqual(assets[133], "https://www.openstack.org")
Example #4
0
 def test_yoyo_get_asserts_by_func(self):
     assets = parse_html(self.yoyo_url, self.yoyo_file)[1]
     # print("\n".join(assets))
     # for asset in assets:
     #     print(get_tld(asset, fail_silently=True), asset)
     self.assertIsNotNone(assets)
     self.assertEqual(assets[0], "http://blog.yoyowallet.com")
     self.assertEqual(
         assets[70],
         "https://support.yoyowallet.com/hc/en-gb/categories/201132913-Legal-and-T-Cs"
     )
Example #5
0
 def test_py_get_links_func(self):
     links = parse_html(self.py_url, self.py_file)[0]
     self.assertEqual(links[0], "http://blog.python.org")
     self.assertEqual(links[74],
                      "https://wiki.python.org/moin/PythonEventsCalendar")