1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
From 97ba2c78e7035f0878a2990945be887070dfb99f Mon Sep 17 00:00:00 2001
From: Erica Portnoy <erica@eff.org>
From: Harlan Lieberman-Berg <hlieberman@debian.org>
Date: Fri, 13 Feb 2026 10:03:46 -0800
Subject: [PATCH] Reset mock call count using reset_mock since new thread-safe
implementation means it can no longer just be set to 0
---
certbot/_internal/tests/reverter_test.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: python-certbot/certbot/_internal/tests/reverter_test.py
===================================================================
--- python-certbot.orig/certbot/_internal/tests/reverter_test.py
+++ python-certbot/certbot/_internal/tests/reverter_test.py
@@ -359,7 +359,7 @@ class TestFullCheckpointsReverter(test_u
# Test Generic warning
self._setup_three_checkpoints()
- mock_logger.warning.call_count = 0
+ mock_logger.warning.reset_mock()
self.reverter.rollback_checkpoints(4)
assert mock_logger.warning.call_count == 1
Index: python-certbot/certbot/_internal/tests/ocsp_test.py
===================================================================
--- python-certbot.orig/certbot/_internal/tests/ocsp_test.py
+++ python-certbot/certbot/_internal/tests/ocsp_test.py
@@ -55,7 +55,7 @@ class OCSPTestOpenSSL(unittest.TestCase)
assert checker.broken is False
mock_exists.return_value = False
- mock_run.call_count = 0
+ mock_run.reset_mock()
checker = ocsp.RevocationChecker(enforce_openssl_binary_usage=True)
assert mock_run.call_count == 0
assert mock_log.call_count == 1
@@ -110,7 +110,7 @@ class OCSPTestOpenSSL(unittest.TestCase)
assert ocsp._translate_ocsp_query(*openssl_confused) is False
assert mock_log.debug.call_count == 1
assert mock_log.warning.call_count == 0
- mock_log.debug.call_count = 0
+ mock_log.debug.reset_mock()
assert ocsp._translate_ocsp_query(*openssl_unknown) is False
assert mock_log.debug.call_count == 1
assert mock_log.warning.call_count == 0
@@ -118,7 +118,7 @@ class OCSPTestOpenSSL(unittest.TestCase)
assert mock_log.debug.call_count == 2
assert ocsp._translate_ocsp_query(*openssl_broken) is False
assert mock_log.warning.call_count == 1
- mock_log.info.call_count = 0
+ mock_log.info.reset_mock()
assert ocsp._translate_ocsp_query(*openssl_revoked) is True
assert mock_log.info.call_count == 0
assert ocsp._translate_ocsp_query(*openssl_expired_ocsp_revoked) is True
|