def assertBad(self, commitmsg, reason_re): res, expl = Actions.verify_commit_message(commitmsg) self.assertFalse( res, """Commit message verification succeeded unexpectedly, for: %s Expected: /%s/""" % (commitmsg, reason_re), ) self.assertNotIn( "\n", expl.strip(), """Commit message verification returned multiple errors (one expected): %s Expected: /%s/ Errors: %s""" % (commitmsg, reason_re, expl), ) (self.assertRegex if hasattr(self, "assertRegex") else self.assertRegexpMatches)( expl, reason_re, """Commit message verification did not return expected error, for: %s Expected: /%s/ Errors: %s""" % (commitmsg, reason_re, expl), )
def assertGood(self, commitmsg): res, expl = Actions.verify_commit_message(commitmsg) self.assertTrue(res, '''Commit message verification failed for: %s Error: %s''' % (commitmsg, expl))
def assertBad(self, commitmsg, reason_re): res, expl = Actions.verify_commit_message(commitmsg) self.assertFalse(res, '''Commit message verification succeeded unexpectedly, for: %s Expected: /%s/''' % (commitmsg, reason_re)) self.assertNotIn('\n', expl.strip(), '''Commit message verification returned multiple errors (one expected): %s Expected: /%s/ Errors: %s''' % (commitmsg, reason_re, expl)) self.assertRegexpMatches(expl, reason_re, '''Commit message verification did not return expected error, for: %s Expected: /%s/ Errors: %s''' % (commitmsg, reason_re, expl))