green-spider/spider/spider_test.py
Marian Steinbach 57f8dea4e0
Improve certificate check to support SNI (#71)
* Fix the certificate check to support SNI
* Better tests for the certificate check
* Activate verbose output when running make test
* Add commenting on the spider test
2018-10-03 21:01:52 +02:00

34 lines
814 B
Python

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()