summaryrefslogtreecommitdiffstats
path: root/qa/test_hooks.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2020-11-03 06:07:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2020-11-03 06:07:48 +0000
commit85812cd25d9e2f015bb71b26d51458b3718bf6c7 (patch)
tree463ad57ffbe3636e06e9bb36104fbf12938e78c1 /qa/test_hooks.py
parentReleasing debian version 0.13.1-6. (diff)
downloadgitlint-85812cd25d9e2f015bb71b26d51458b3718bf6c7.tar.xz
gitlint-85812cd25d9e2f015bb71b26d51458b3718bf6c7.zip
Merging upstream version 0.14.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'qa/test_hooks.py')
-rw-r--r--qa/test_hooks.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/qa/test_hooks.py b/qa/test_hooks.py
index a41580b..7c07a61 100644
--- a/qa/test_hooks.py
+++ b/qa/test_hooks.py
@@ -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",