Ejemplo n.º 1
0
    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')
Ejemplo n.º 2
0
    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')
Ejemplo n.º 3
0
    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)
Ejemplo n.º 4
0
 def setUp(self):
     self.problems = Problems()
     self.tool = Yamllint(self.problems)
Ejemplo n.º 5
0
 def setUp(self):
     self.problems = Problems()
     self.tool = Yamllint(self.problems, {}, root_dir)