Skip to content

Commit 7a0d508

Browse files
committed
Noah + Copilot feedback
1 parent 5734a23 commit 7a0d508

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

test/test_ocsp_support.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@ def test_other_key_type(self):
171171
self.assertEqual(len(result), 20)
172172

173173

174-
class TestGetCertsByKeyHash(unittest.TestCase):
174+
class TestGetCerts(unittest.TestCase):
175175
@patch("pymongo.ocsp_support._public_key_hash")
176-
def test_match(self, mock_hash):
176+
def test_by_key_hash_match(self, mock_hash):
177177
issuer = Mock()
178178
issuer.subject = "issuer_subject"
179179
cert1 = Mock()
@@ -186,7 +186,7 @@ def test_match(self, mock_hash):
186186
self.assertEqual(result, [cert1])
187187

188188
@patch("pymongo.ocsp_support._public_key_hash")
189-
def test_no_match(self, mock_hash):
189+
def test_by_key_hash_no_match(self, mock_hash):
190190
issuer = Mock()
191191
issuer.subject = "issuer_subject"
192192
cert = Mock()
@@ -196,9 +196,7 @@ def test_no_match(self, mock_hash):
196196
result = _get_certs_by_key_hash([cert], issuer, b"expected_hash")
197197
self.assertEqual(result, [])
198198

199-
200-
class TestGetCertsByName(unittest.TestCase):
201-
def test_match(self):
199+
def test_by_name_match(self):
202200
issuer = Mock()
203201
issuer.subject = "issuer"
204202
cert1 = Mock()
@@ -211,7 +209,7 @@ def test_match(self):
211209
result = _get_certs_by_name([cert1, cert2], issuer, "responder")
212210
self.assertEqual(result, [cert1])
213211

214-
def test_no_match(self):
212+
def test_by_name_no_match(self):
215213
issuer = Mock()
216214
issuer.subject = "issuer"
217215
cert = Mock()
@@ -222,7 +220,7 @@ def test_no_match(self):
222220
self.assertEqual(result, [])
223221

224222

225-
class TestBuildOcspRequest(unittest.TestCase):
223+
class TestVerifyResponseSignature(unittest.TestCase):
226224
@patch("pymongo.ocsp_support._OCSPRequestBuilder")
227225
def test_builds_request(self, mock_builder_class):
228226
mock_builder = Mock()
@@ -237,8 +235,6 @@ def test_builds_request(self, mock_builder_class):
237235
mock_builder.add_certificate.assert_called_once()
238236
mock_builder.build.assert_called_once()
239237

240-
241-
class TestVerifyResponseSignature(unittest.TestCase):
242238
@patch("pymongo.ocsp_support._verify_signature")
243239
def test_responder_is_issuer_by_name(self, mock_verify_sig):
244240
mock_verify_sig.return_value = 1

0 commit comments

Comments
 (0)