MCPcopy
hub / github.com/urllib3/urllib3 / test_wrap_existing_socket

Method test_wrap_existing_socket

test/test_ssltransport.py:154–165  ·  view source on GitHub ↗

Validates a single TLS layer can be established.

(self)

Source from the content-addressed store, hash-verified

152
153 @pytest.mark.timeout(PER_TEST_TIMEOUT)
154 def test_wrap_existing_socket(self) -> None:
155 """Validates a single TLS layer can be established."""
156 self.start_dummy_server()
157
158 sock = socket.create_connection((self.host, self.port))
159 with SSLTransport(
160 sock, self.client_context, server_hostname="localhost"
161 ) as ssock:
162 assert ssock.version() is not None
163 ssock.send(sample_request())
164 response = consume_socket(ssock)
165 validate_response(response)
166
167 @pytest.mark.timeout(PER_TEST_TIMEOUT)
168 def test_unbuffered_text_makefile(self) -> None:

Callers

nothing calls this directly

Calls 7

start_dummy_serverMethod · 0.95
SSLTransportClass · 0.90
consume_socketFunction · 0.90
sample_requestFunction · 0.85
validate_responseFunction · 0.85
versionMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected