(self)
| 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() |
nothing calls this directly
no test coverage detected