Commit bc954b24 authored by Adrien Dorsaz's avatar Adrien Dorsaz
Browse files

test: add a test to check an error is raised if configuration is not complete

parent 835bb9b7
......@@ -87,13 +87,19 @@ def gen_configs():
config["acmednstiny"]["CSRFile"] =
with open(, 'w') as configfile:
missingDNS = NamedTemporaryFile()
config["DNS"] = {}
with open(, 'w') as configfile:
return {
"goodCName": goodCName,
"dnsHostIP": dnsHostIP,
"goodSAN": goodSAN,
"weakKey": weakKey,
"accountAsDomain": accountAsDomain,
"missingDNS": missingDNS,
"key": {"accountkey": account_key,
"weakkey": weak_key,
"domainkey": domain_key},
......@@ -83,6 +83,14 @@ class TestModule(unittest.TestCase):
self.assertIsInstance(result, ValueError)
self.assertIn("Certificate public key must be different than account key", result.args[0])
def test_failure_notcompleted_configuration(self):
""" Configuration file have to be completed """
result = acme_dns_tiny.main([CONFIGS['missingDNS'].name])
except Exception as e:
result = e
self.assertIsInstance(result, ValueError)
self.assertIn("Some required settings are missing.", result.args[0])
if __name__ == "__main__":
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment