1
0
Fork 0

Merging upstream version 0.14.0.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-13 06:02:10 +01:00
parent 4c68f51a53
commit e916bee311
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
109 changed files with 2822 additions and 912 deletions

View file

@ -53,6 +53,18 @@ class HookTests(BaseTestCase):
stdin.put("{0}\n".format(response))
self.response_index = (self.response_index + 1) % len(self.responses)
def test_commit_hook_no_violations(self):
test_filename = self.create_simple_commit(u"This ïs a title\n\nBody contënt that should work",
out=self._interact, tty_in=True)
short_hash = self.get_last_commit_short_hash()
expected_output = ["gitlint: checking commit message...\n",
"gitlint: \x1b[32mOK\x1b[0m (no violations in commit message)\n",
u"[master %s] This ïs a title\n" % short_hash,
" 1 file changed, 0 insertions(+), 0 deletions(-)\n",
u" create mode 100644 %s\n" % test_filename]
self.assertListEqual(expected_output, self.githook_output)
def test_commit_hook_continue(self):
self.responses = ["y"]
test_filename = self.create_simple_commit(u"WIP: This ïs a title.\nContënt on the second line",