Fixed bad references in test_socket_ssl.py
This commit is contained in:
@@ -5,6 +5,16 @@ from eventlet.green import socket
|
|||||||
from eventlet.green import urllib
|
from eventlet.green import urllib
|
||||||
from eventlet.green import threading
|
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:
|
try:
|
||||||
socket.ssl
|
socket.ssl
|
||||||
socket.sslerror
|
socket.sslerror
|
||||||
@@ -22,6 +32,13 @@ test_basic = patcher.patch_function(test_basic,
|
|||||||
test_rude_shutdown = patcher.patch_function(test_rude_shutdown,
|
test_rude_shutdown = patcher.patch_function(test_rude_shutdown,
|
||||||
('threading', threading))
|
('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__":
|
if __name__ == "__main__":
|
||||||
test_main()
|
test_main()
|
||||||
|
Reference in New Issue
Block a user