示例#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)))
示例#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)))
示例#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)))
示例#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)))
示例#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)))
示例#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)))
示例#7
0
 def test_should_filter_out_the_whitelist(self):
     warnings = whitelist_filter(self.WARNINGS, "foo")
     self.assertEqual(1, len(list(warnings)))
示例#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)))
示例#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)))
示例#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)))
示例#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)))
示例#12
0
 def test_should_filter_out_the_whitelist(self):
     warnings = whitelist_filter(self.WARNINGS, "foo")
     self.assertEqual(1, len(list(warnings)))