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

Method client_sock

Lib/test/test_asyncio/test_ssl.py:346–365  ·  view source on GitHub ↗
(addr)

Source from the content-addressed store, hash-verified

344 await self.wait_closed(writer)
345
346 async def client_sock(addr):
347 sock = socket.socket()
348 sock.connect(addr)
349 reader, writer = await asyncio.open_connection(
350 sock=sock,
351 ssl=client_sslctx,
352 server_hostname='')
353
354 writer.write(A_DATA)
355 self.assertEqual(await reader.readexactly(2), b'OK')
356
357 writer.write(B_DATA)
358 self.assertEqual(await reader.readexactly(4), b'SPAM')
359
360 nonlocal CNT
361 CNT += 1
362
363 writer.close()
364 await self.wait_closed(writer)
365 sock.close()
366
367 def run(coro):
368 nonlocal CNT

Callers

nothing calls this directly

Calls 7

wait_closedMethod · 0.95
socketMethod · 0.80
readexactlyMethod · 0.80
connectMethod · 0.45
writeMethod · 0.45
assertEqualMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected