summaryrefslogtreecommitdiff
path: root/tests/stdlib
diff options
context:
space:
mode:
authorRyan Williams <rdw@lindenlab.com>2010-02-24 22:28:57 -0800
committerRyan Williams <rdw@lindenlab.com>2010-02-24 22:28:57 -0800
commit4ec2cc509f249a66717d885bc59e4e4a9a105590 (patch)
tree6f97153888b39c1a09779adbf29a912e22a6e375 /tests/stdlib
parent6b8f995fad47622064d9f97033c8f8a65767a294 (diff)
downloadeventlet-4ec2cc509f249a66717d885bc59e4e4a9a105590.tar.gz
Fixed bad references in test_socket_ssl.py
Diffstat (limited to 'tests/stdlib')
-rw-r--r--tests/stdlib/test_socket_ssl.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/stdlib/test_socket_ssl.py b/tests/stdlib/test_socket_ssl.py
index 3814fea..d418e1a 100644
--- a/tests/stdlib/test_socket_ssl.py
+++ b/tests/stdlib/test_socket_ssl.py
@@ -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()