diff options
author | Christian Heimes <christian@python.org> | 2018-02-24 20:10:57 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-24 20:10:57 (GMT) |
commit | 141c5e8c2437a9fed95a04c81e400ef725592a17 (patch) | |
tree | 01d9c30cff72bfe58a95cf2013758581adcc7907 /Lib/test/test_ssl.py | |
parent | b18f8bc1a77193c372d79afa79b284028a2842d7 (diff) | |
download | cpython-141c5e8c2437a9fed95a04c81e400ef725592a17.zip cpython-141c5e8c2437a9fed95a04c81e400ef725592a17.tar.gz cpython-141c5e8c2437a9fed95a04c81e400ef725592a17.tar.bz2 |
bpo-24334: Cleanup SSLSocket (#5252)
* The SSLSocket is no longer implemented on top of SSLObject to
avoid an extra level of indirection.
* Owner and session are now handled in the internal constructor.
* _ssl._SSLSocket now uses the same method names as SSLSocket and
SSLObject.
* Channel binding type check is now handled in C code. Channel binding
is always available.
The patch also changes the signature of SSLObject.__init__(). In my
opinion it's fine. A SSLObject is not a user-constructable object.
SSLContext.wrap_bio() is the only valid factory.
Diffstat (limited to 'Lib/test/test_ssl.py')
-rw-r--r-- | Lib/test/test_ssl.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index 7aa1123..3f2c50b 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -455,6 +455,8 @@ class BasicSocketTests(unittest.TestCase): self.assertRaises(OSError, ss.recvfrom_into, bytearray(b'x'), 1) self.assertRaises(OSError, ss.send, b'x') self.assertRaises(OSError, ss.sendto, b'x', ('0.0.0.0', 0)) + self.assertRaises(NotImplementedError, ss.sendmsg, + [b'x'], (), 0, ('0.0.0.0', 0)) def test_timeout(self): # Issue #8524: when creating an SSL socket, the timeout of the @@ -3381,11 +3383,13 @@ class ThreadedTests(unittest.TestCase): chatty=False) as server: with context.wrap_socket(socket.socket()) as s: self.assertIs(s.version(), None) + self.assertIs(s._sslobj, None) s.connect((HOST, server.port)) if ssl.OPENSSL_VERSION_INFO >= (1, 0, 2): self.assertEqual(s.version(), 'TLSv1.2') else: # 0.9.8 to 1.0.1 self.assertIn(s.version(), ('TLSv1', 'TLSv1.2')) + self.assertIs(s._sslobj, None) self.assertIs(s.version(), None) @unittest.skipUnless(ssl.HAS_TLSv1_3, |