def assert_linter_works(self, linter_name, extension):
        """Checks that the given linter works well for all the extensions.

        It requires that 3 files are defined:
        - <linter>/original.<extension>: A file with errors
        - <linter>/error.<extension>: New errors are introduced.
        - <linter>/nonewerror.<extension>: A line was modified/added from the
          last file, but no new errors are introduced.
        """
        data_dirname = os.path.join(
            os.path.dirname(os.path.realpath(__file__)), 'data')
        self.filename_repo = filename_repo = os.path.join(
            self.temp_directory, '%s%s' % (linter_name, extension))
        filename_original = os.path.join(
            data_dirname, linter_name, 'original%s' % extension)
        filename_error = os.path.join(
            data_dirname, linter_name, 'error%s' % extension)
        filename_nonewerror = os.path.join(
            data_dirname, linter_name, 'nonewerror%s' % extension)

        self.assertTrue(
            os.path.exists(filename_original),
            'You must define file "%s"' % filename_original)
        self.assertTrue(
            os.path.exists(filename_error),
            'You must define file "%s"' % filename_error)
        self.assertTrue(os.path.exists(
            filename_nonewerror),
            'You must define file "%s"' % filename_nonewerror)

        # Add file 1 (original) to repo
        shutil.copy(filename_original, filename_repo)
        self.add(filename_repo)
        self.commit('Commit 1')

        # Add file 2 (error) to repo
        shutil.copy(filename_error, filename_repo)
        response, output = self.lint()
        self.assertNotEquals(
            0, response,
            ('Git lint for file %s should have failed.\n git-lint output: %s' +
             '\nLinter Output:\n%s') %
            (filename_error,
             output,
             self.get_linter_output(linter_name, filename_repo)))
        self.add(filename_repo)
        self.commit('Commit 2')

        # Add file 3 (nonewerror) to repo
        shutil.copy(filename_nonewerror, filename_repo)
        response, output = self.lint()
        self.assertEquals(
            0, response,
            ('Git lint for file %s should have not failed. \nOutput:\n%s') %
            (filename_nonewerror, output))
        self.add(filename_repo)
        self.commit('Commit 3')
dataset/ETHPy150Open sk-/git-lint/test/e2etest/test_e2e.py/E2EBase.assert_linter_works/original