diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2020-11-03 06:07:45 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2020-11-03 06:07:45 +0000 |
commit | 5f208e04c159791e668031a7fa83f98724ec8d24 (patch) | |
tree | 4b58b42fd2a91a14871010e2dd39369a839ae383 /qa/test_user_defined.py | |
parent | Adding upstream version 0.13.1. (diff) | |
download | gitlint-5f208e04c159791e668031a7fa83f98724ec8d24.tar.xz gitlint-5f208e04c159791e668031a7fa83f98724ec8d24.zip |
Adding upstream version 0.14.0.upstream/0.14.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'qa/test_user_defined.py')
-rw-r--r-- | qa/test_user_defined.py | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/qa/test_user_defined.py b/qa/test_user_defined.py index cf7effd..566d0b2 100644 --- a/qa/test_user_defined.py +++ b/qa/test_user_defined.py @@ -7,14 +7,24 @@ from qa.base import BaseTestCase class UserDefinedRuleTests(BaseTestCase): """ Integration tests for user-defined rules.""" - def test_user_defined_rules_examples(self): + def test_user_defined_rules_examples1(self): + """ Test the user defined rules in the top-level `examples/` directory """ extra_path = self.get_example_path() commit_msg = u"WIP: Thi$ is å title\nContent on the second line" self.create_simple_commit(commit_msg) output = gitlint("--extra-path", extra_path, _cwd=self.tmp_git_repo, _tty_in=True, _ok_code=[5]) self.assertEqualStdout(output, self.get_expected("test_user_defined/test_user_defined_rules_examples_1")) + def test_user_defined_rules_examples2(self): + """ Test the user defined rules in the top-level `examples/` directory """ + extra_path = self.get_example_path() + commit_msg = u"Release: Thi$ is å title\nContent on the second line\n$This line is ignored \nThis isn't\t\n" + self.create_simple_commit(commit_msg) + output = gitlint("--extra-path", extra_path, _cwd=self.tmp_git_repo, _tty_in=True, _ok_code=[4]) + self.assertEqualStdout(output, self.get_expected("test_user_defined/test_user_defined_rules_examples_2")) + def test_user_defined_rules_examples_with_config(self): + """ Test the user defined rules in the top-level `examples/` directory """ extra_path = self.get_example_path() commit_msg = u"WIP: Thi$ is å title\nContent on the second line" self.create_simple_commit(commit_msg) @@ -27,8 +37,9 @@ class UserDefinedRuleTests(BaseTestCase): extra_path = self.get_sample_path("user_rules/extra") commit_msg = u"WIP: Thi$ is å title\nContent on the second line" self.create_simple_commit(commit_msg) - output = gitlint("--extra-path", extra_path, _cwd=self.tmp_git_repo, _tty_in=True, _ok_code=[5]) - self.assertEqualStdout(output, self.get_expected("test_user_defined/test_user_defined_rules_extra_1")) + output = gitlint("--extra-path", extra_path, _cwd=self.tmp_git_repo, _tty_in=True, _ok_code=[9]) + self.assertEqualStdout(output, self.get_expected("test_user_defined/test_user_defined_rules_extra_1", + {'repo-path': self.tmp_git_repo})) def test_invalid_user_defined_rules(self): extra_path = self.get_sample_path("user_rules/incorrect_linerule") |