Beispiel #1
0
  def test_excludes_parsed_loaded_correctly(self):
    excludes_text = dedent('''
      # ignore C++
      .*\.cpp

      # ignore python
      .*\.py''')
    excluder = FileExcluder(self._create_scalastyle_excludes_file([excludes_text]), logger)
    self.assertEqual(2, len(excluder.excludes))
    self.assertTrue(excluder.should_include('com/some/org/x.scala'))
    self.assertFalse(excluder.should_include('com/some/org/y.cpp'))
    self.assertFalse(excluder.should_include('z.py'))
Beispiel #2
0
 def test_excludes_setting_exists_but_invalid(self):
   with self.assertRaises(TaskError):
     FileExcluder('file_does_not_exist.txt', logger)