def assert_no_error(self, lines): def handler(error_handler, line_number, category, confidence, message): self.fail('Unexpected error: %d %s %d %s' % (line_number, category, confidence, message)) error_handler = TestErrorHandler(handler) checker = xcodeproj.XcodeProjectFileChecker('', error_handler) checker.check(lines)
def assert_error(self, lines, expected_message): self.had_error = False def handler(error_handler, line_number, category, confidence, message): self.assertEqual(expected_message, message) self.had_error = True error_handler = TestErrorHandler(handler) checker = xcodeproj.XcodeProjectFileChecker('', error_handler) checker.check(lines) self.assertTrue(self.had_error, '%s should have error: %s.' % (lines, expected_message))