diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-09 13:38:02 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-09 13:38:02 +0000 |
commit | 6f442e774b9236c999f36c2d7af17640f49bff99 (patch) | |
tree | 47e73755bffd41bdde2d59d76cc595f5a1fa75d4 /qa/test_contrib.py | |
parent | Initial commit. (diff) | |
download | gitlint-6f442e774b9236c999f36c2d7af17640f49bff99.tar.xz gitlint-6f442e774b9236c999f36c2d7af17640f49bff99.zip |
Adding upstream version 0.19.1.upstream/0.19.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | qa/test_contrib.py | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/qa/test_contrib.py b/qa/test_contrib.py new file mode 100644 index 0000000..d3a45ba --- /dev/null +++ b/qa/test_contrib.py @@ -0,0 +1,31 @@ +from qa.base import BaseTestCase +from qa.shell import gitlint + + +class ContribRuleTests(BaseTestCase): + """Integration tests for contrib rules.""" + + def test_contrib_rules(self): + self.create_simple_commit("WIP Thi$ is å title\n\nMy bödy that is a bit longer than 20 chars") + output = gitlint( + "--contrib", "contrib-title-conventional-commits,CC1", _cwd=self.tmp_git_repo, _tty_in=True, _ok_code=[3] + ) + self.assertEqualStdout(output, self.get_expected("test_contrib/test_contrib_rules_1")) + + def test_contrib_rules_with_config(self): + self.create_simple_commit("WIP Thi$ is å title\n\nMy bödy that is a bit longer than 20 chars") + output = gitlint( + "--contrib", + "contrib-title-conventional-commits,CC1", + "-c", + "contrib-title-conventional-commits.types=föo,bår", + _cwd=self.tmp_git_repo, + _tty_in=True, + _ok_code=[3], + ) + self.assertEqualStdout(output, self.get_expected("test_contrib/test_contrib_rules_with_config_1")) + + def test_invalid_contrib_rules(self): + self.create_simple_commit("WIP: test") + output = gitlint("--contrib", "föobar,CC1", _cwd=self.tmp_git_repo, _tty_in=True, _ok_code=[255]) + self.assertEqualStdout(output, "Config Error: No contrib rule with id or name 'föobar' found.\n") |