Port eventlet.green.OpenSSL to Python 3
* Fix import syntax for Python 3: use relative imports * Add unit test
This commit is contained in:

committed by
Sergey Shepelev

parent
3ba7b02dfa
commit
e9f19c6df4
@@ -1,5 +1,5 @@
|
|||||||
import rand
|
from . import rand
|
||||||
import crypto
|
from . import crypto
|
||||||
import SSL
|
from . import SSL
|
||||||
import tsafe
|
from . import tsafe
|
||||||
from version import __version__
|
from .version import __version__
|
||||||
|
17
tests/openssl_test.py
Normal file
17
tests/openssl_test.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import tests
|
||||||
|
|
||||||
|
|
||||||
|
def test_import():
|
||||||
|
# https://github.com/eventlet/eventlet/issues/238
|
||||||
|
# Ensure that it's possible to import eventlet.green.OpenSSL.
|
||||||
|
# Most basic test to check Python 3 compatibility.
|
||||||
|
try:
|
||||||
|
import OpenSSL
|
||||||
|
except ImportError:
|
||||||
|
raise tests.SkipTest('need pyopenssl')
|
||||||
|
|
||||||
|
import eventlet.green.OpenSSL.SSL
|
||||||
|
import eventlet.green.OpenSSL.crypto
|
||||||
|
import eventlet.green.OpenSSL.rand
|
||||||
|
import eventlet.green.OpenSSL.tsafe
|
||||||
|
import eventlet.green.OpenSSL.version
|
Reference in New Issue
Block a user