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

test: close correctly temporary configuration files at end of tests

parent e41a13cf
......@@ -102,6 +102,22 @@ class TestModule(unittest.TestCase):
self.assertIn("Some required settings are missing.", result.args[0])
if __name__ == "__main__":
unittest.main()
# delete account key registration at end of tests
delete_account(CONFIGS["key"]["accountkey"].name)
try:
unittest.main()
finally:
# delete account key registration at end of tests
delete_account(CONFIGS["key"]["accountkey"].name)
# close temp files correctly
CONFIGS["goodCName"].close()
CONFIGS["dnsHostIP"].close()
CONFIGS["goodSAN"].close()
CONFIGS["weakKey"].close()
CONFIGS["accountAsDomain"].close()
CONFIGS["invalidTSIGName"].close()
CONFIGS["missingDNS"].close()
CONFIGS["key"]["accountkey"].close()
CONFIGS["key"]["weakkey"].close()
CONFIGS["key"]["domainkey"].close()
CONFIGS["csr"]["domaincsr"].close()
CONFIGS["csr"]["sancsr"].close()
CONFIGS["csr"]["accountcsr"].close()
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