(self)
| 1263 | self.assertIsNone(cm.exc_value) |
| 1264 | |
| 1265 | def test_load_verify_locations(self): |
| 1266 | ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) |
| 1267 | ctx.load_verify_locations(CERTFILE) |
| 1268 | ctx.load_verify_locations(cafile=CERTFILE, capath=None) |
| 1269 | ctx.load_verify_locations(BYTES_CERTFILE) |
| 1270 | ctx.load_verify_locations(cafile=BYTES_CERTFILE, capath=None) |
| 1271 | self.assertRaises(TypeError, ctx.load_verify_locations) |
| 1272 | self.assertRaises(TypeError, ctx.load_verify_locations, None, None, None) |
| 1273 | with self.assertRaises(OSError) as cm: |
| 1274 | ctx.load_verify_locations(NONEXISTINGCERT) |
| 1275 | self.assertEqual(cm.exception.errno, errno.ENOENT) |
| 1276 | with self.assertRaisesRegex(ssl.SSLError, "PEM (lib|routines)"): |
| 1277 | ctx.load_verify_locations(BADCERT) |
| 1278 | ctx.load_verify_locations(CERTFILE, CAPATH) |
| 1279 | ctx.load_verify_locations(CERTFILE, capath=BYTES_CAPATH) |
| 1280 | |
| 1281 | # Issue #10989: crash if the second argument type is invalid |
| 1282 | self.assertRaises(TypeError, ctx.load_verify_locations, None, True) |
| 1283 | |
| 1284 | def test_load_verify_cadata(self): |
| 1285 | # test cadata |
nothing calls this directly
no test coverage detected