def assertNoError(self, lines): """Asserts that the specified lines has no errors.""" self.had_error = False def error_for_test(filename, line_number, category, confidence, message): """Records if an error occurs.""" self.had_error = True text_style.process_file_data('', lines, error_for_test) self.assert_(not self.had_error, '%s should not have any errors.' % lines)
def assertError(self, lines, expected_line_number): """Asserts that the specified lines has an error.""" self.had_error = False def error_for_test(filename, line_number, category, confidence, message): """Checks if the expected error occurs.""" self.assertEquals(expected_line_number, line_number) self.assertEquals('whitespace/tab', category) self.had_error = True text_style.process_file_data('', lines, error_for_test) self.assert_(self.had_error, '%s should have an error [whitespace/tab].' % lines)