MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_load_verify_locations

Method test_load_verify_locations

Lib/test/test_ssl.py:1265–1282  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

assertRaisesRegexMethod · 0.80
load_verify_locationsMethod · 0.45
assertRaisesMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected