reached 100% testing cover

This commit is contained in:
Alvaro Andrés Rodríguez Scelza 2019-06-13 21:33:58 -03:00
parent a9d54a63fc
commit 8e79502b8a
10 changed files with 13 additions and 0 deletions

View file

@ -7,6 +7,7 @@ from pre_commit_hooks.loaderon_hooks.util.template_methods.lines_checker_templat
class ClassDocstringChecker(LinesCheckerTemplateMethod):
def _check_line(self):
super(ClassDocstringChecker, self)._check_line()
regular_expression = r'^(\t| )*class .+\(.*\):'
pattern = re.compile(regular_expression)
if pattern.match(self._file_line):

View file

@ -15,6 +15,7 @@ class LinesChecker(LinesCheckerTemplateMethod):
self.check_arguments_size_match(self.args.line_to_check, self.args.regexp_to_match)
def _check_line(self):
super(LinesChecker, self)._check_line()
for line_index, line_to_check in enumerate(self.args.line_to_check):
line_to_check_pattern = re.compile(line_to_check)
if line_to_check_pattern.match(self._file_line):

View file

@ -25,6 +25,7 @@ class LocationChecker(FileCheckerTemplateMethod):
def _check_file(self):
"""Check filename location against enabled directories and their enabled files."""
super(LocationChecker, self)._check_file()
self.check_arguments_size_match(self.args.directories, self.args.files)
file_directory_path = os.path.dirname(self.filename)
file_name = os.path.basename(self.filename)

View file

@ -19,6 +19,7 @@ class PylintChecker(FileCheckerTemplateMethod):
self.parser.add_argument('-e', '--exclude', help='Excluded files to check.')
def _check_file(self):
super(PylintChecker, self)._check_file()
try:
self.run_pylint_except_in_excluded_files()
except SystemExit as exception:

View file

@ -9,6 +9,7 @@ class XMLEncodingChecker(FileCheckerTemplateMethod):
self.parser.add_argument('-e', '--encoding', help='Desired encoding.')
def _check_file(self):
super(XMLEncodingChecker, self)._check_file()
first_line = read_file_line(self.filename)
desired_encoding = self.args.encoding.rstrip()
first_line = first_line.rstrip('\n')