summaryrefslogtreecommitdiff
path: root/tests/util.py
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2013-12-27 12:26:33 -0500
committerOleg Pudeyev <oleg@bsdpower.com>2013-12-27 14:44:26 -0500
commit9f68b8d33992f21ba3876a89535f81937506a64d (patch)
tree4f150095e34573905181c85066752523545615eb /tests/util.py
parent55fb3a2a67c2cb0971153f89538d8b7bb08fa6a7 (diff)
downloadpycurl-9f68b8d33992f21ba3876a89535f81937506a64d.tar.gz
Fix test suite on ssl-less libcurl
Diffstat (limited to 'tests/util.py')
-rw-r--r--tests/util.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/util.py b/tests/util.py
index ce4190b..1926dd7 100644
--- a/tests/util.py
+++ b/tests/util.py
@@ -63,6 +63,22 @@ def min_libcurl(major, minor, patch):
return decorator
+def only_ssl(fn):
+ import nose.plugins.skip
+ import pycurl
+
+ @functools.wraps(fn)
+ def decorated(*args, **kwargs):
+ # easier to check that pycurl supports https, although
+ # theoretically it is not the same test.
+ # pycurl.version_info()[8] is a tuple of protocols supported by libcurl
+ if 'https' not in pycurl.version_info()[8]:
+ raise nose.plugins.skip.SkipTest('libcurl does not support ssl')
+
+ return fn(*args, **kwargs)
+
+ return decorated
+
try:
create_connection = socket.create_connection
except AttributeError: