Fixed bad references in test_socket_ssl.py

This commit is contained in:
Ryan Williams
2010-02-24 22:28:57 -08:00
parent 6b8f995fad
commit 4ec2cc509f

View File

@@ -5,6 +5,16 @@ from eventlet.green import socket
from eventlet.green import urllib
from eventlet.green import threading
# enable network resource
import test.test_support
i_r_e = test.test_support.is_resource_enabled
def is_resource_enabled(resource):
if resource == 'network':
return True
else:
return i_r_e(resource)
test.test_support.is_resource_enabled = is_resource_enabled
try:
socket.ssl
socket.sslerror
@@ -22,6 +32,13 @@ test_basic = patcher.patch_function(test_basic,
test_rude_shutdown = patcher.patch_function(test_rude_shutdown,
('threading', threading))
def test_main():
if not hasattr(socket, "ssl"):
raise test_support.TestSkipped("socket module has no ssl support")
test_rude_shutdown()
test_basic()
test_timeout()
if __name__ == "__main__":
test_main()