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

Method test_context

Lib/test/test_poplib.py:460–470  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

458 self.assertIn('POP3_SSL', poplib.__all__)
459
460 def test_context(self):
461 ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
462 ctx.check_hostname = False
463 ctx.verify_mode = ssl.CERT_NONE
464
465 self.client.quit()
466 self.client = poplib.POP3_SSL(self.server.host, self.server.port,
467 context=ctx)
468 self.assertIsInstance(self.client.sock, ssl.SSLSocket)
469 self.assertIs(self.client.sock.context, ctx)
470 self.assertStartsWith(self.client.noop(), b'+OK')
471
472 def test_stls(self):
473 self.assertRaises(poplib.error_proto, self.client.stls)

Callers

nothing calls this directly

Calls 5

assertIsInstanceMethod · 0.80
assertStartsWithMethod · 0.80
quitMethod · 0.45
assertIsMethod · 0.45
noopMethod · 0.45

Tested by

no test coverage detected