def test_lgpl_with_lf_file(self):
        # Be verbose by default
        common.g_trace = True

        # Load the test file
        dir_path = os.path.dirname(os.path.realpath(__file__))
        file = common.file_on_disk(dir_path + '/data/forbidtoken_lf.cpp')

        # Apply the hook
        result = forbidtoken.forbidtoken(file, 'lgpl')

        # Check result
        self.assertFalse(result, "lgpl were detected in test file.")
Beispiel #2
0
    def test_check_xml_with_invalid_xml_file(self):
        # Be verbose by default
        common.g_trace = True

        # Load the test file
        dir_path = os.path.dirname(os.path.realpath(__file__))
        file = common.file_on_disk(dir_path + '/data/check_xml_invalid.xml')

        # Apply the hook
        result = check_xml.check_xml(file)

        # Check result
        self.assertTrue(result, "Invalid xml detected as valid.")
    def test_tab_with_tab_file(self):
        # Be verbose by default
        common.g_trace = True

        # Load the test file
        dir_path = os.path.dirname(os.path.realpath(__file__))
        file = common.file_on_disk(dir_path + '/data/forbidtoken_tab.cpp')

        # Apply the hook
        result = forbidtoken.forbidtoken(file, 'tab')

        # Check result
        self.assertTrue(result, "tab were not detected in test file.")