This commit is contained in:
2021-08-30 12:58:04 +02:00
parent e892152b0c
commit e64ce32d92
3 changed files with 35 additions and 35 deletions

View File

@@ -22,14 +22,14 @@ pitc_nameservers = [
'ns5.dnsmadeeasy.com.',
'ns6.dnsmadeeasy.com.',
'ns7.dnsmadeeasy.com.'
]
]
# list of puzzle managed zone files
pitc_domains = [
'puzzle.ch.yaml',
'puzzle.yaml',
'nonpuzzle.yaml'
]
]
# configure opendns resolver
resolver = resolver.Resolver()

View File

@@ -16,23 +16,23 @@ from pylint.reporters import CollectingReporter
class TestDnsVerify(unittest.TestCase):
def test_do_check(self):
'''
... Test if checks acutally fail when an error occures.
... Test whether checks acutally fail when an error occures.
'''
self.assertEqual(do_check(['puzzle.ch'], ['ns1.google.com'], verbose=False),
False)
def test_get_authoritative_ns(self):
'''
... Test if garbage queries trigger a stack trace.
... Test whether garbage queries trigger a stack trace.
'''
self.assertEqual(get_authoritative_ns('dinimer.lolwas'), [])
def test_get_domains_from_yaml(self):
'''
... Test wheter missing files generate an empty list.
... Test whether missing files generate an empty list.
'''
self.assertEqual(get_domains_from_yaml(["notexist.yaml"]), [])
def test_verify_authoritative_ns(self):
'''
... Test wheter false is returned when the ns does not match the list. And test if type errors are handeled correctly.
... Test whether false if check fails and test if type errors are handeled correctly.
'''
self.assertEqual(verify_authoritative_ns('ns1.google.com', ['ns2.google.com']), False)
self.assertRaises(TypeError, verify_authoritative_ns, 123, ['123'])
@@ -40,7 +40,7 @@ class TestDnsVerify(unittest.TestCase):
def test_pylint(self):
'''
... Test wheter the coding style is acceptable.
... Test whether the coding style is acceptable.
'''
rep = CollectingReporter()
results = Run(['dnsverify.py', '-sn'], reporter=rep, exit=False)

View File

@@ -1,3 +1,3 @@
#!/bin/env bash
pipenv run python -m unittest -bv test_dnsverify
pipenv run python -m unittest -bv dnsverify_tests.py