Ejemplo n.º 1
0
 def test_should_ignore_comments_in_whitelist(self):
     whitelist = Whitelist('foo  #,bar\ni#,bar')
     warnings = list(whitelist.filter(self.WARNINGS))
     self.assertEqual(1, len(warnings))
Ejemplo n.º 2
0
 def test_should_filter_mutiple_functions_defined_on_one_line(self):
     whitelist = Whitelist('foo, bar')
     warnings = list(whitelist.filter(self.WARNINGS))
     self.assertEqual(0, len(warnings))
Ejemplo n.º 3
0
 def test_should_filter_mutiple_lines_of_whitelist(self):
     whitelist = Whitelist('foo\n bar')
     warnings = list(whitelist.filter(self.WARNINGS))
     self.assertEqual(0, len(warnings))
Ejemplo n.º 4
0
 def test_should_filter_function_in_the_right_file_when_specified(self):
     whitelist = Whitelist('filename:foo')
     warnings = list(whitelist.filter(self.WARNINGS))
     self.assertEqual(2, len(warnings))
Ejemplo n.º 5
0
 def test_should_work_with_class_member(self):
     whitelist = Whitelist('class::foo')
     warnings = list(whitelist.filter([(FunctionInfo("class::foo"), "filename")]))
     self.assertEqual(0, len(warnings))
Ejemplo n.º 6
0
 def test_should_ignore_comments_in_whitelist(self):
     whitelist = Whitelist('foo  #,bar\ni#,bar')
     warnings = list(whitelist.filter(self.WARNINGS))
     self.assertEqual(1, len(warnings))
Ejemplo n.º 7
0
 def test_should_filter_out_the_whitelist(self):
     whitelist = Whitelist("foo")
     warnings = list(whitelist.filter(self.WARNINGS))
     self.assertEqual(1, len(warnings))
Ejemplo n.º 8
0
 def test_should_filter_mutiple_lines_of_whitelist(self):
     whitelist = Whitelist('foo\n bar')
     warnings = list(whitelist.filter(self.WARNINGS))
     self.assertEqual(0, len(warnings))
Ejemplo n.º 9
0
 def test_should_filter_mutiple_functions_defined_on_one_line(self):
     whitelist = Whitelist('foo, bar')
     warnings = list(whitelist.filter(self.WARNINGS))
     self.assertEqual(0, len(warnings))
Ejemplo n.º 10
0
 def test_should_work_with_class_member(self):
     whitelist = Whitelist('class::foo')
     warnings = list(
         whitelist.filter([(FunctionInfo("class::foo"), "filename")]))
     self.assertEqual(0, len(warnings))
Ejemplo n.º 11
0
 def test_should_filter_function_in_the_right_file_when_specified(self):
     whitelist = Whitelist('filename:foo')
     warnings = list(whitelist.filter(self.WARNINGS))
     self.assertEqual(2, len(warnings))
Ejemplo n.º 12
0
 def test_should_filter_out_the_whitelist(self):
     whitelist = Whitelist("foo")
     warnings = list(whitelist.filter(self.WARNINGS))
     self.assertEqual(1, len(warnings))