MCPcopy
hub / github.com/python-trio/trio / setup

Function setup

src/trio/_tests/test_ssl.py:1322–1341  ·  view source on GitHub ↗
(
        https_compatible: bool = False,
    )

Source from the content-addressed store, hash-verified

1320
1321async def test_SSLListener(client_ctx: SSLContext) -> None:
1322 async def setup(
1323 https_compatible: bool = False,
1324 ) -> tuple[tsocket.SocketType, SSLListener[SocketStream], SSLStream[SocketStream]]:
1325 listen_sock = tsocket.socket()
1326 await listen_sock.bind(("127.0.0.1", 0))
1327 listen_sock.listen(1)
1328 socket_listener = SocketListener(listen_sock)
1329 ssl_listener = SSLListener(
1330 socket_listener,
1331 SERVER_CTX,
1332 https_compatible=https_compatible,
1333 )
1334
1335 transport_client = await open_tcp_stream(*listen_sock.getsockname())
1336 ssl_client = SSLStream(
1337 transport_client,
1338 client_ctx,
1339 server_hostname="trio-test-1.example.org",
1340 )
1341 return listen_sock, ssl_listener, ssl_client
1342
1343 listen_sock, ssl_listener, ssl_client = await setup()
1344

Callers 1

test_SSLListenerFunction · 0.70

Calls 8

open_tcp_streamFunction · 0.90
SocketListenerClass · 0.85
SSLListenerClass · 0.85
SSLStreamClass · 0.85
socketMethod · 0.45
bindMethod · 0.45
listenMethod · 0.45
getsocknameMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…