def test_should_ignore_comments_in_whitelist(self): warnings = whitelist_filter(self.WARNINGS, 'foo #,bar\ni#,bar') self.assertEqual(1, len(list(warnings)))
def test_should_filter_mutiple_functions_defined_on_one_line(self): warnings = whitelist_filter(self.WARNINGS, 'foo, bar') self.assertEqual(0, len(list(warnings)))
def test_should_filter_mutiple_lines_of_whitelist(self): warnings = whitelist_filter(self.WARNINGS, 'foo\n bar') self.assertEqual(0, len(list(warnings)))
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)))
def test_should_work_with_class_member(self): warnings = whitelist_filter([FunctionInfo("class::foo", 'filename')], 'class::foo') self.assertEqual(0, len(list(warnings)))
def test_should_filter_out_the_whitelist(self): warnings = whitelist_filter(self.WARNINGS, "foo") self.assertEqual(1, len(list(warnings)))