Test Failed
Push — develop ( 2f2c0e...2adb06 )
by Dean
02:41
created

PyOpenSSL   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 18
Duplicated Lines 0 %
Metric Value
dl 0
loc 18
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A test_import() 0 14 1
1
from plugin.core.libraries.tests.core.base import TestBase
0 ignored issues
show
Bug introduced by
The name base does not seem to exist in module plugin.core.libraries.tests.core.
Loading history...
Configuration introduced by
Unable to import 'plugin.core.libraries.tests.core.base' (invalid syntax (<string>, line 40))

This can be caused by one of the following:

1. Missing Dependencies

This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.

# .scrutinizer.yml
before_commands:
    - sudo pip install abc # Python2
    - sudo pip3 install abc # Python3
Tip: We are currently not using virtualenv to run pylint, when installing your modules make sure to use the command for the correct version.

2. Missing __init__.py files

This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.

Loading history...
2
from plugin.core.logger.handlers.error_reporter import RAVEN
3
4
5
class PyOpenSSL(TestBase):
0 ignored issues
show
Coding Style introduced by
This class has no __init__ method.
Loading history...
6
    name = 'pyopenssl'
7
    optional = True
8
9
    @staticmethod
10
    def test_import():
11
        import OpenSSL
12
13
        # Inject pyopenssl into requests
14
        from requests.packages.urllib3.contrib.pyopenssl import inject_into_urllib3
15
        inject_into_urllib3()
16
17
        # Enable secure error reporting
18
        RAVEN.set_protocol('requests+https')
19
20
        return {
21
            'versions': {
22
                'pyopenssl': getattr(OpenSSL, '__version__', None)
23
            }
24
        }
25