cleanup
This commit is contained in:
@@ -22,14 +22,14 @@ pitc_nameservers = [
|
|||||||
'ns5.dnsmadeeasy.com.',
|
'ns5.dnsmadeeasy.com.',
|
||||||
'ns6.dnsmadeeasy.com.',
|
'ns6.dnsmadeeasy.com.',
|
||||||
'ns7.dnsmadeeasy.com.'
|
'ns7.dnsmadeeasy.com.'
|
||||||
]
|
]
|
||||||
|
|
||||||
# list of puzzle managed zone files
|
# list of puzzle managed zone files
|
||||||
pitc_domains = [
|
pitc_domains = [
|
||||||
'puzzle.ch.yaml',
|
'puzzle.ch.yaml',
|
||||||
'puzzle.yaml',
|
'puzzle.yaml',
|
||||||
'nonpuzzle.yaml'
|
'nonpuzzle.yaml'
|
||||||
]
|
]
|
||||||
|
|
||||||
# configure opendns resolver
|
# configure opendns resolver
|
||||||
resolver = resolver.Resolver()
|
resolver = resolver.Resolver()
|
||||||
|
|||||||
@@ -16,23 +16,23 @@ from pylint.reporters import CollectingReporter
|
|||||||
class TestDnsVerify(unittest.TestCase):
|
class TestDnsVerify(unittest.TestCase):
|
||||||
def test_do_check(self):
|
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),
|
self.assertEqual(do_check(['puzzle.ch'], ['ns1.google.com'], verbose=False),
|
||||||
False)
|
False)
|
||||||
def test_get_authoritative_ns(self):
|
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'), [])
|
self.assertEqual(get_authoritative_ns('dinimer.lolwas'), [])
|
||||||
def test_get_domains_from_yaml(self):
|
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"]), [])
|
self.assertEqual(get_domains_from_yaml(["notexist.yaml"]), [])
|
||||||
def test_verify_authoritative_ns(self):
|
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.assertEqual(verify_authoritative_ns('ns1.google.com', ['ns2.google.com']), False)
|
||||||
self.assertRaises(TypeError, verify_authoritative_ns, 123, ['123'])
|
self.assertRaises(TypeError, verify_authoritative_ns, 123, ['123'])
|
||||||
@@ -40,7 +40,7 @@ class TestDnsVerify(unittest.TestCase):
|
|||||||
|
|
||||||
def test_pylint(self):
|
def test_pylint(self):
|
||||||
'''
|
'''
|
||||||
... Test wheter the coding style is acceptable.
|
... Test whether the coding style is acceptable.
|
||||||
'''
|
'''
|
||||||
rep = CollectingReporter()
|
rep = CollectingReporter()
|
||||||
results = Run(['dnsverify.py', '-sn'], reporter=rep, exit=False)
|
results = Run(['dnsverify.py', '-sn'], reporter=rep, exit=False)
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
#!/bin/env bash
|
#!/bin/env bash
|
||||||
|
|
||||||
pipenv run python -m unittest -bv test_dnsverify
|
pipenv run python -m unittest -bv dnsverify_tests.py
|
||||||
|
|||||||
Reference in New Issue
Block a user