summaryrefslogtreecommitdiffstats
path: root/qa/test_named_rules.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_named_rules.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_named_rules.py')
-rw-r--r--qa/test_named_rules.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/qa/test_named_rules.py b/qa/test_named_rules.py
new file mode 100644
index 0000000..6020bbf
--- /dev/null
+++ b/qa/test_named_rules.py
@@ -0,0 +1,23 @@
+# -*- coding: utf-8 -*-
+from qa.shell import gitlint
+from qa.base import BaseTestCase
+
+
+class NamedRuleTests(BaseTestCase):
+ """ Integration tests for named rules."""
+
+ def test_named_rule(self):
+ commit_msg = u"WIP: thåt dûr bår\n\nSïmple commit body"
+ self.create_simple_commit(commit_msg)
+ config_path = self.get_sample_path("config/named-rules")
+ output = gitlint("--config", config_path, _cwd=self.tmp_git_repo, _tty_in=True, _ok_code=[5])
+ self.assertEqualStdout(output, self.get_expected("test_named_rules/test_named_rule_1"))
+
+ def test_named_user_rule(self):
+ commit_msg = u"Normal cömmit title\n\nSïmple commit message body"
+ self.create_simple_commit(commit_msg)
+ config_path = self.get_sample_path("config/named-user-rules")
+ extra_path = self.get_sample_path("user_rules/extra")
+ output = gitlint("--extra-path", extra_path, "--config", config_path, _cwd=self.tmp_git_repo, _tty_in=True,
+ _ok_code=[9])
+ self.assertEqualStdout(output, self.get_expected("test_named_rules/test_named_user_rule_1"))