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

Method testClose

Lib/test/test_socket.py:5131–5141  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5129
5130class TCPCloserTest(ThreadedTCPSocketTest):
5131 def testClose(self):
5132 conn, _ = self.serv.accept()
5133
5134 read, _, _ = select.select([conn], [], [], support.SHORT_TIMEOUT)
5135 self.assertEqual(read, [conn])
5136 self.assertEqual(conn.recv(1), b'x')
5137 conn.close()
5138
5139 # Calling close() many times should be safe.
5140 conn.close()
5141 conn.close()
5142
5143 def _testClose(self):
5144 self.cli.connect((HOST, self.port))

Callers

nothing calls this directly

Calls 5

acceptMethod · 0.45
selectMethod · 0.45
assertEqualMethod · 0.45
recvMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected