MCPcopy Index your code
hub / github.com/python/cpython / test_invalid_certdata

Method test_invalid_certdata

Lib/test/test_httpservers.py:450–468  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

448 server.server_close()
449
450 def test_invalid_certdata(self):
451 invalid_certdata = [
452 (self.BADCERT, None, None),
453 (self.EMPTYCERT, None, None),
454 (self.ONLYCERT, None, None),
455 (self.ONLYKEY, None, None),
456 (self.ONLYKEY, self.ONLYCERT, None),
457 (self.CERTFILE_PROTECTED, None, self.BADPASSWORD),
458 # TODO: test the next case and add same case to test_ssl (We
459 # specify a cert and a password-protected file, but no password):
460 # (self.CERTFILE_PROTECTED, None, None),
461 # see issue #132102
462 ]
463 for certfile, keyfile, password in invalid_certdata:
464 with self.subTest(
465 certfile=certfile, keyfile=keyfile, password=password
466 ):
467 with self.assertRaises(ssl.SSLError):
468 create_https_server(certfile, keyfile, password)
469
470
471class RequestHandlerLoggingTestCase(BaseTestCase):

Callers

nothing calls this directly

Calls 3

create_https_serverFunction · 0.85
subTestMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected