Esempio n. 1
0
    def test_process_files_with_config(self):
        config = {'config': 'tests/fixtures/luacheck/luacheckrc'}
        tool = Luacheck(self.problems, config)
        tool.process_files(self.fixtures)

        problems = self.problems.all(self.fixtures[2])
        eq_(1, len(problems), 'Config file should lower error count.')
Esempio n. 2
0
    def test_process_files_with_missing_config(self):
        config = {'config': 'not_a_file'}
        tool = Luacheck(self.problems, config, root_dir)
        tool.process_files(self.fixtures)

        problems = self.problems.all()
        self.assertEqual(1, len(problems), "Couldn't load configuration from")
        self.assertIn("Couldn't", problems[0].body)
        self.assertIn("configuration", problems[0].body)
        self.assertIn("not_a_file", problems[0].body)
Esempio n. 3
0
 def setUp(self):
     self.problems = Problems()
     self.tool = Luacheck(self.problems, {}, root_dir)
Esempio n. 4
0
 def setUp(self):
     self.problems = Problems()
     self.tool = Luacheck(self.problems)