Hilft Dir dabei, Deine BÜNDNIS 90/DIE GRÜNEN Website zu optimieren
https://green-spider.netzbegruenung.de/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
814 B
33 lines
814 B
import unittest |
|
from pprint import pprint |
|
|
|
from spider.spider import check_and_rate_site |
|
|
|
class TestSpider(unittest.TestCase): |
|
|
|
""" |
|
Simply calls the spider.check_and_rate_site function |
|
with httpbin.org URLs. We don't assert a lot here, |
|
but at least make sure that most of our code is executed |
|
in tests. |
|
""" |
|
|
|
def test_html(self): |
|
"""Loads a simple HTML web page""" |
|
|
|
entry = { |
|
"url": "https://httpbin.org/html", |
|
"type": "type", |
|
"state": "state", |
|
"level": "level", |
|
"district": "district", |
|
"city": "city", |
|
} |
|
|
|
url = "https://httpbin.org/html" |
|
result = check_and_rate_site(entry) |
|
|
|
self.assertEqual(result["input_url"], url) |
|
|
|
if __name__ == '__main__': |
|
unittest.main()
|
|
|