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

Method test_keylog_env

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

Source from the content-addressed store, hash-verified

5005 @unittest.skipIf(sys.flags.ignore_environment,
5006 "test is not compatible with ignore_environment")
5007 def test_keylog_env(self):
5008 self.addCleanup(os_helper.unlink, os_helper.TESTFN)
5009 with unittest.mock.patch.dict(os.environ):
5010 os.environ['SSLKEYLOGFILE'] = os_helper.TESTFN
5011 self.assertEqual(os.environ['SSLKEYLOGFILE'], os_helper.TESTFN)
5012
5013 ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
5014 self.assertEqual(ctx.keylog_filename, None)
5015
5016 try:
5017 ctx = ssl.create_default_context()
5018 except RuntimeError:
5019 if Py_DEBUG_WIN32:
5020 self.skipTest("not supported on Win32 debug build")
5021 raise
5022 self.assertEqual(ctx.keylog_filename, os_helper.TESTFN)
5023
5024 ctx = ssl._create_stdlib_context()
5025 self.assertEqual(ctx.keylog_filename, os_helper.TESTFN)
5026
5027 def test_msg_callback(self):
5028 client_context, server_context, hostname = testing_context()

Callers

nothing calls this directly

Calls 4

addCleanupMethod · 0.80
skipTestMethod · 0.80
dictMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected