summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Paul Calderone <exarkun@divmod.com>2011-09-08 18:29:32 -0400
committerJean-Paul Calderone <exarkun@divmod.com>2011-09-08 18:29:32 -0400
commitc62d4c11f6ff3d5a3629b6e9a471dac6a6b561ae (patch)
tree159faa929ecf257f48dbfb17149d8af929378a1e
parent0222a4994ef23cd580b0f9c65332e0c1612830df (diff)
downloadpyopenssl-c62d4c11f6ff3d5a3629b6e9a471dac6a6b561ae.tar.gz
Add a constant test for NO_NO_COMPRESSION
-rw-r--r--OpenSSL/test/test_ssl.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/OpenSSL/test/test_ssl.py b/OpenSSL/test/test_ssl.py
index 4c58345..9e64d64 100644
--- a/OpenSSL/test/test_ssl.py
+++ b/OpenSSL/test/test_ssl.py
@@ -52,6 +52,11 @@ except ImportError:
OP_NO_TICKET = None
try:
+ from OpenSSL.SSL import OP_NO_COMPRESSION
+except ImportError:
+ OP_NO_COMPRESSION = None
+
+try:
from OpenSSL.SSL import MODE_RELEASE_BUFFERS
except ImportError:
MODE_RELEASE_BUFFERS = None
@@ -1611,6 +1616,17 @@ class ConstantsTests(TestCase):
"OP_NO_TICKET unavailable - OpenSSL version may be too old"
+ if OP_NO_COMPRESSION is not None:
+ def test_op_no_compression(self):
+ """
+ The value of L{OpenSSL.SSL.OP_NO_COMPRESSION} is 0x20000, the value
+ of L{SSL_OP_NO_COMPRESSION} defined by I{openssl/ssl.h}.
+ """
+ self.assertEqual(OP_NO_COMPRESSION, 0x20000)
+ else:
+ "OP_NO_COMPRESSION unavailable - OpenSSL version may be too old"
+
+
class MemoryBIOTests(TestCase, _LoopbackMixin):
"""