Commit 330889d9 authored by Denis Bilenko's avatar Denis Bilenko

test__server.py: add TestSSLSocketNotAllowed

parent dd84c259
...@@ -336,6 +336,24 @@ class TestNoneSpawn(TestCase): ...@@ -336,6 +336,24 @@ class TestNoneSpawn(TestCase):
class ExpectedError(Exception): class ExpectedError(Exception):
pass pass
class TestSSLSocketNotAllowed(TestCase):
switch_expected = False
def get_spawn(self):
return gevent.spawn
if hasattr(socket, 'ssl'):
def test(self):
from gevent.socket import ssl, socket
listener = socket()
listener.bind(('0.0.0.0', 0))
listener.listen(5)
listener = ssl(listener)
self.assertRaises(TypeError, self.ServerSubClass, listener)
# test non-socket.error exception in accept call: fatal # test non-socket.error exception in accept call: fatal
# test error in spawn(): non-fatal # test error in spawn(): non-fatal
# test error in spawned handler: non-fatal # test error in spawned handler: non-fatal
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment