(
self, sock: socket.socket, server_hostname: str | None
)
| 1038 | ) |
| 1039 | |
| 1040 | def _wrap_socket_and_mock_warn( |
| 1041 | self, sock: socket.socket, server_hostname: str | None |
| 1042 | ) -> tuple[Mock, MagicMock]: |
| 1043 | mock_context = Mock() |
| 1044 | with patch("warnings.warn") as warn: |
| 1045 | ssl_wrap_socket( |
| 1046 | ssl_context=mock_context, |
| 1047 | sock=sock, |
| 1048 | server_hostname=server_hostname, |
| 1049 | ) |
| 1050 | return mock_context, warn |
| 1051 | |
| 1052 | def test_ssl_wrap_socket_sni_ip_address_no_warn(self) -> None: |
| 1053 | """Test that a warning is not made if server_hostname is an IP address.""" |
no test coverage detected