def test_process_files_with_config(self): config = {'config': 'tests/fixtures/yamllint/config.yaml'} tool = Yamllint(self.problems, config) tool.process_files([self.fixtures[0]]) problems = self.problems.all(self.fixtures[0]) eq_(1, len(problems), 'Config file should cause errors on no_errors.yml')
def test_process_files__config(self): config = {'config': 'tests/fixtures/yamllint/config.yaml'} tool = Yamllint(self.problems, config, root_dir) tool.process_files([self.fixtures[0]]) problems = self.problems.all(self.fixtures[0]) self.assertEqual(1, len(problems), 'Config file should cause errors on no_errors.yml')
def test_process_files__missing_config(self): config = {'config': 'tests/fixtures/yamllint/lol.yaml'} tool = Yamllint(self.problems, config, root_dir) tool.process_files([self.fixtures[0]]) problems = self.problems.all() eq_(1, len(problems)) assert_in( '`yamllint` failed with the following error:\n' '```\n' "IOError: [Errno 2] No such file or directory: '/src/tests/fixtures/yamllint/lol.yaml'\n" '```\n', problems[0].body)
def setUp(self): self.problems = Problems() self.tool = Yamllint(self.problems)
def setUp(self): self.problems = Problems() self.tool = Yamllint(self.problems, {}, root_dir)