From 9fa1feffc765eac9cdaf723d1e527925932b120f Mon Sep 17 00:00:00 2001 From: Brad Warren Date: Wed, 20 May 2020 15:14:14 -0700 Subject: [PATCH] fix tests --- certbot-apache/tests/apache_util_test.py | 6 ++++++ certbot-apache/tests/ocsp_prefetch_test.py | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/certbot-apache/tests/apache_util_test.py b/certbot-apache/tests/apache_util_test.py index c0a24512d..ae5dcad30 100644 --- a/certbot-apache/tests/apache_util_test.py +++ b/certbot-apache/tests/apache_util_test.py @@ -1,4 +1,6 @@ """Tests for certbot_apache._internal.apache_util.""" +import unittest + import certbot.tests.util as test_util @@ -13,3 +15,7 @@ class CertFingerprintTest(unittest.TestCase): cert_sha1_fingerprint(cert_path), b'\t\xf8\xce\x01E\r(\x84g\xc32j\xc0E~5\x199\xc7.' ) + + +if __name__ == "__main__": + unittest.main() # pragma: no cover diff --git a/certbot-apache/tests/ocsp_prefetch_test.py b/certbot-apache/tests/ocsp_prefetch_test.py index 29bd342e6..19255ed87 100644 --- a/certbot-apache/tests/ocsp_prefetch_test.py +++ b/certbot-apache/tests/ocsp_prefetch_test.py @@ -220,9 +220,9 @@ class OCSPPrefetchTest(util.ApacheTest): @mock.patch("certbot_apache._internal.constants.OCSP_INTERNAL_TTL", 0) def test_ocsp_prefetch_refresh(self): - def ocsp_req_mock(_cert, _chain, _timeout, workfile): + def ocsp_req_mock(_cert, _chain, response_file): """Method to mock the OCSP request and write response to file""" - with open(workfile, 'w') as fh: + with open(response_file, 'w') as fh: fh.write("MOCKRESPONSE") return False