|
|
@ -19,8 +19,7 @@ import unittest
|
|
|
|
import yaml
|
|
|
|
import yaml
|
|
|
|
|
|
|
|
|
|
|
|
from yamllint.config import YamlLintConfig
|
|
|
|
from yamllint.config import YamlLintConfig
|
|
|
|
from yamllint.errors import LintProblem
|
|
|
|
from yamllint import linter
|
|
|
|
from yamllint import lint
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class RuleTestCase(unittest.TestCase):
|
|
|
|
class RuleTestCase(unittest.TestCase):
|
|
|
@ -44,9 +43,9 @@ class RuleTestCase(unittest.TestCase):
|
|
|
|
rule_id = kwargs[key][2]
|
|
|
|
rule_id = kwargs[key][2]
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
rule_id = self.rule_id
|
|
|
|
rule_id = self.rule_id
|
|
|
|
expected_problems.append(
|
|
|
|
expected_problems.append(linter.LintProblem(
|
|
|
|
LintProblem(kwargs[key][0], kwargs[key][1], rule=rule_id))
|
|
|
|
kwargs[key][0], kwargs[key][1], rule=rule_id))
|
|
|
|
expected_problems.sort()
|
|
|
|
expected_problems.sort()
|
|
|
|
|
|
|
|
|
|
|
|
real_problems = list(lint(source, self.build_fake_config(conf)))
|
|
|
|
real_problems = list(linter.run(source, self.build_fake_config(conf)))
|
|
|
|
self.assertEqual(real_problems, expected_problems)
|
|
|
|
self.assertEqual(real_problems, expected_problems)
|
|
|
|