Exemplo n.º 1
0
    def test_pylint(self):
        if not pylint_wrapper.PYLINT_AVAILABLE:
            self.skipTest(
                'Pylint not available, probably because this test is running '
                'under @mode/opt: {}'.format(
                    pylint_wrapper.PYLINT_IMPORT_PROBLEM))

        py_wrap = pylint_wrapper.PyLintWrapper(
            disable_ids=[
                'no-member',  # doesn't handle decorators correctly
                'unexpected-keyword-arg',
                # doesn't handle decorators correctly
                'no-value-for-parameter',
                # doesn't handle decorators correctly
                'fixme',  # allow todos
                'unnecessary-pass',  # triggers when pass is ok
                'raise-missing-from',
            ],
            show_categories=["warning", "error", "fatal"],
        )

        directories = [
            'enodebd',
            # 'mobilityd',
            'pipelined',
            # 'pkt_tester',
            'policydb',
            # 'redirectd',
            'subscriberdb',
        ]
        parent_path = os.path.dirname(os.path.dirname(__file__))
        for directory in directories:
            path = os.path.join(parent_path, directory)
            py_wrap.assertNoLintErrors(path)
Exemplo n.º 2
0
    def test_pylint(self):
        if not pylint_wrapper.PYLINT_AVAILABLE:
            self.skipTest(
                'Pylint not available, probably because this test is running '
                'under @mode/opt: {}'.format(
                    pylint_wrapper.PYLINT_IMPORT_PROBLEM))

        py_wrap = pylint_wrapper.PyLintWrapper(
            disable_ids=[
                'no-member',  # doesn't handle decorators correctly
                'unexpected-keyword-arg',
                # doesn't handle decorators correctly
                'no-value-for-parameter',
                # doesn't handle decorators correctly
                'fixme',  # allow todos
                'unnecessary-pass',  # triggers when pass is ok
            ],
            show_categories=["warning", "error", "fatal"],
        )

        directories = [
            'common',
            'configuration',
            'directoryd',
            'magmad',
            'state',
        ]
        parent_path = os.path.dirname(os.path.dirname(__file__))
        for directory in directories:
            path = os.path.join(parent_path, directory)
            py_wrap.assertNoLintErrors(path)
Exemplo n.º 3
0
    def test_pylint(self):
        if not pylint_wrapper.PYLINT_AVAILABLE:
            self.skipTest(
                'Pylint not available, probably because this test is running '
                'under @mode/opt: {}'.format(
                    pylint_wrapper.PYLINT_IMPORT_PROBLEM, ), )

        py_wrap = pylint_wrapper.PyLintWrapper(
            disable_ids=[
                'no-member',  # doesn't handle decorators correctly
                'unexpected-keyword-arg',
                # doesn't handle decorators correctly
                'no-value-for-parameter',
                # doesn't handle decorators correctly
                'fixme',  # allow todos
                'unnecessary-pass',  # triggers when pass is ok
                'raise-missing-from',
                'redundant-u-string-prefix',
            ],
            show_categories=["warning", "error", "fatal"],
        )

        excluded_directories = []

        parent_path = os.path.dirname(os.path.dirname(__file__))
        directories = [
            d.name for d in os.scandir(parent_path)
            if d.is_dir() and d.name not in excluded_directories
        ]
        for directory in directories:
            path = os.path.join(parent_path, directory)
            py_wrap.assertNoLintErrors(path)
Exemplo n.º 4
0
    def test_pylint(self):
        if not pylint_wrapper.PYLINT_AVAILABLE:
            self.skipTest(
                'Pylint not available, probably because this test is running '
                'under @mode/opt: {}'.format(
                    pylint_wrapper.PYLINT_IMPORT_PROBLEM))

        py_wrap = pylint_wrapper.PyLintWrapper(
            disable_ids=[
                'no-member',  # doesn't handle decorators correctly
                'no-value-for-parameter',  # doesn't handle decorators correctly
                'fixme',  # all todos
                'unnecessary-pass',  # triggers when pass is ok
            ],
            show_categories=["warning", "error", "fatal"])

        # set up path from python/magma/<service>/tests/pylint_tests.py to
        # python/magma/<service>/
        path = os.path.dirname(os.path.dirname(__file__))
        py_wrap.assertNoLintErrors(path)