コード例 #1
0
ファイル: test_manager.py プロジェクト: SalemAmeen/bandit
    def test_is_file_included(self):
        a = manager._is_file_included(path="a.py", included_globs=["*.py"], excluded_path_strings="", enforce_glob=True)

        b = manager._is_file_included(
            path="a.dd", included_globs=["*.py"], excluded_path_strings="", enforce_glob=False
        )

        c = manager._is_file_included(
            path="a.py", included_globs=["*.py"], excluded_path_strings="a.py", enforce_glob=True
        )

        d = manager._is_file_included(path="a.dd", included_globs=["*.py"], excluded_path_strings="", enforce_glob=True)
        self.assertTrue(a)
        self.assertTrue(b)
        self.assertFalse(c)
        self.assertFalse(d)
コード例 #2
0
    def test_is_file_included(self):
        a = manager._is_file_included(path='a.py', included_globs=['*.py'],
                                      excluded_path_strings='',
                                      enforce_glob=True)

        b = manager._is_file_included(path='a.dd', included_globs=['*.py'],
                                      excluded_path_strings='',
                                      enforce_glob=False)

        c = manager._is_file_included(path='a.py', included_globs=['*.py'],
                                      excluded_path_strings='a.py',
                                      enforce_glob=True)

        d = manager._is_file_included(path='a.dd', included_globs=['*.py'],
                                      excluded_path_strings='',
                                      enforce_glob=True)
        self.assertTrue(a)
        self.assertTrue(b)
        self.assertFalse(c)
        self.assertFalse(d)
コード例 #3
0
ファイル: test_manager.py プロジェクト: PyCQA/bandit
    def test_is_file_included(self):
        a = manager._is_file_included(
            path="a.py",
            included_globs=["*.py"],
            excluded_path_strings=[],
            enforce_glob=True,
        )

        b = manager._is_file_included(
            path="a.dd",
            included_globs=["*.py"],
            excluded_path_strings=[],
            enforce_glob=False,
        )

        c = manager._is_file_included(
            path="a.py",
            included_globs=["*.py"],
            excluded_path_strings=["a.py"],
            enforce_glob=True,
        )

        d = manager._is_file_included(
            path="a.dd",
            included_globs=["*.py"],
            excluded_path_strings=[],
            enforce_glob=True,
        )

        e = manager._is_file_included(
            path="x_a.py",
            included_globs=["*.py"],
            excluded_path_strings=["x_*.py"],
            enforce_glob=True,
        )

        f = manager._is_file_included(
            path="x.py",
            included_globs=["*.py"],
            excluded_path_strings=["x_*.py"],
            enforce_glob=True,
        )
        self.assertTrue(a)
        self.assertTrue(b)
        self.assertFalse(c)
        self.assertFalse(d)
        self.assertFalse(e)
        self.assertTrue(f)