This is roughly socket2.diff from issue 1378, with a few changes applied

to ssl.py (no need to test whether we can dup any more).
Regular sockets no longer have a _base, but we still have explicit
reference counting of socket objects for the benefit of makefile();
using duplicate sockets won't work for SSLSocket.
This commit is contained in:
Guido van Rossum 2007-11-16 01:24:05 +00:00
parent dd9e3b8736
commit 39eb8fa0db
5 changed files with 126 additions and 118 deletions

View file

@ -575,6 +575,15 @@ class BasicTCPTest(SocketConnectedTest):
def _testFromFd(self):
self.serv_conn.send(MSG)
def testDup(self):
# Testing dup()
sock = self.cli_conn.dup()
msg = sock.recv(1024)
self.assertEqual(msg, MSG)
def _testDup(self):
self.serv_conn.send(MSG)
def testShutdown(self):
# Testing shutdown()
msg = self.cli_conn.recv(1024)