mirror of
https://github.com/netzbegruenung/green-spider.git
synced 2024-05-04 01:53:40 +02:00
c065da4957
* Add test for dns_resolution * Add test for domain_variations * Add test for duplicate_content
24 lines
738 B
Python
24 lines
738 B
Python
import unittest
|
|
from pprint import pprint
|
|
|
|
from checks import dns_resolution
|
|
from checks.config import Config
|
|
|
|
class TestDNSResolution(unittest.TestCase):
|
|
|
|
def test_google(self):
|
|
"""Resolves www.google.com"""
|
|
url = 'https://www.google.com/'
|
|
config = Config(urls=[url])
|
|
checker = dns_resolution.Checker(config=config, previous_results={})
|
|
result = checker.run()
|
|
|
|
self.assertIn(url, result)
|
|
self.assertEqual(result[url]['hostname'], 'www.google.com')
|
|
self.assertTrue(result[url], 'resolvable')
|
|
self.assertIsInstance(result[url]['ipv4_addresses'], list)
|
|
self.assertNotEqual(result[url]['ipv4_addresses'], [])
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|