-
Notifications
You must be signed in to change notification settings - Fork 196
Conversation
@@ -40,7 +40,6 @@ def test_custom_context(self): | |||
|
|||
assert not hyper.tls._context.check_hostname | |||
assert hyper.tls._context.verify_mode == ssl.CERT_NONE | |||
assert hyper.tls._context.options & ssl.OP_NO_COMPRESSION == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Python 3.6 fails on this line with an error:
______________________________________________________________________________ TestSSLContext.test_custom_context _________
self = <test_SSLContext.TestSSLContext object at 0x10d106b70>
def test_custom_context(self):
# The following SSLContext doesn't provide any valid certicate.
# Its purpose is only to confirm that hyper is not using its
# default SSLContext.
context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
context.verify_mode = ssl.CERT_NONE
context.check_hostname = False
hyper.tls._context = context
assert not hyper.tls._context.check_hostname
assert hyper.tls._context.verify_mode == ssl.CERT_NONE
> assert hyper.tls._context.options & ssl.OP_NO_COMPRESSION == 0
E AssertionError: assert (<Options.OP_ALL|OP_NO_SSLv3|OP_NO_SSLv2|OP_CIPHER_SERVER_PREFERENCE|OP_SINGLE_DH_USE|OP_SINGLE_ECDH_USE|OP_NO_COMPRESSION: 2203714559> & <Options.OP_NO_COMPRESSION: 131072>) == 0
E + where <Options.OP_ALL|OP_NO_SSLv3|OP_NO_SSLv2|OP_CIPHER_SERVER_PREFERENCE|OP_SINGLE_DH_USE|OP_SINGLE_ECDH_USE|OP_NO_COMPRESSION: 2203714559> = <ssl.SSLContext object at 0x10d102898>.options
E + where <ssl.SSLContext object at 0x10d102898> = <module 'hyper.tls' from '/Users/kostya/Code/_contrib/hyper/hyper/tls.py'>._context
E + where <module 'hyper.tls' from '/Users/kostya/Code/_contrib/hyper/hyper/tls.py'> = hyper.tls
E + and <Options.OP_NO_COMPRESSION: 131072> = ssl.OP_NO_COMPRESSION
test/test_SSLContext.py:43: AssertionError
From what I understand this check is not essential in the test. Please let me know if I'm wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole test seems kinda stupid, to be honest, but yeah, this line is non-essential.
@@ -40,7 +40,6 @@ def test_custom_context(self): | |||
|
|||
assert not hyper.tls._context.check_hostname | |||
assert hyper.tls._context.verify_mode == ssl.CERT_NONE | |||
assert hyper.tls._context.options & ssl.OP_NO_COMPRESSION == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole test seems kinda stupid, to be honest, but yeah, this line is non-essential.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, looks great! ✨
No description provided.