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