| Conditions | 2 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 1 |
| CRAP Score | 4.5185 |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | 1 | from plugin.core.libraries.tests.core.base import BaseTest |
|
| 8 | 1 | @staticmethod |
|
| 9 | def test_import(): |
||
| 10 | import OpenSSL.SSL |
||
| 11 | |||
| 12 | # Try construct SSL context |
||
| 13 | ctx = OpenSSL.SSL.Context(OpenSSL.SSL.SSLv23_METHOD) |
||
| 14 | |||
| 15 | # Ensure library has SNI support |
||
| 16 | cnx = OpenSSL.SSL.Connection(ctx) |
||
| 17 | |||
| 18 | if not hasattr(cnx, 'set_tlsext_host_name'): |
||
| 19 | raise Exception('Missing SNI extension') |
||
| 20 | |||
| 21 | return { |
||
| 22 | 'versions': { |
||
| 23 | 'pyopenssl': getattr(OpenSSL, '__version__', None) |
||
| 24 | } |
||
| 36 |