diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-14 14:47:08 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-09-14 14:47:08 (GMT) |
commit | 5974cdd5f598423002709d912276963c2032c69a (patch) | |
tree | 6194b100caec2d1cbcb93b5097e1626079d42b8c /Lib/test/test_ssl.py | |
parent | 3a883214ee3e7d79b14dcd42720d8efe55c147ad (diff) | |
download | cpython-5974cdd5f598423002709d912276963c2032c69a.zip cpython-5974cdd5f598423002709d912276963c2032c69a.tar.gz cpython-5974cdd5f598423002709d912276963c2032c69a.tar.bz2 |
Merged revisions 84807 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r84807 | antoine.pitrou | 2010-09-14 16:43:44 +0200 (mar., 14 sept. 2010) | 4 lines
Issue #9853: Fix the signature of SSLSocket.recvfrom() and
SSLSocket.sendto() to match the corresponding socket methods.
........
Diffstat (limited to 'Lib/test/test_ssl.py')
-rw-r--r-- | Lib/test/test_ssl.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index b622da5..987a425 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -92,6 +92,18 @@ class BasicTests(unittest.TestCase): del ss self.assertEqual(wr(), None) + def test_wrapped_unconnected(self): + # Methods on an unconnected SSLSocket propagate the original + # socket.error raise by the underlying socket object. + s = socket.socket(socket.AF_INET) + ss = ssl.wrap_socket(s) + self.assertRaises(socket.error, ss.recv, 1) + self.assertRaises(socket.error, ss.recv_into, bytearray(b'x')) + self.assertRaises(socket.error, ss.recvfrom, 1) + self.assertRaises(socket.error, ss.recvfrom_into, bytearray(b'x'), 1) + self.assertRaises(socket.error, ss.send, b'x') + self.assertRaises(socket.error, ss.sendto, b'x', ('0.0.0.0', 0)) + def test_timeout(self): # Issue #8524: when creating an SSL socket, the timeout of the # original socket should be retained. |