summaryrefslogtreecommitdiffstats
path: root/qa/test_commits.py
diff options
context:
space:
mode:
Diffstat (limited to 'qa/test_commits.py')
-rw-r--r--qa/test_commits.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/qa/test_commits.py b/qa/test_commits.py
index d40c211..11d1851 100644
--- a/qa/test_commits.py
+++ b/qa/test_commits.py
@@ -1,10 +1,9 @@
-# pylint: disable=too-many-function-args,unexpected-keyword-arg
import re
import arrow
-from qa.shell import echo, git, gitlint
from qa.base import BaseTestCase
+from qa.shell import echo, git, gitlint
class CommitsTests(BaseTestCase):
@@ -111,6 +110,11 @@ class CommitsTests(BaseTestCase):
self.assertEqual(output.exit_code, 2)
self.assertEqualStdout(output, expected)
+ # Lint using --commits <commit sha>,
+ output = gitlint("--commits", f"{commit_sha},", _cwd=self.tmp_git_repo, _tty_in=True, _ok_code=[2])
+ self.assertEqual(output.exit_code, 2)
+ self.assertEqualStdout(output, expected)
+
# Lint a single commit using --commits <refspec> pointing to the single commit
output = gitlint("--commits", refspec, _cwd=self.tmp_git_repo, _tty_in=True, _ok_code=[2])
self.assertEqual(output.exit_code, 2)
@@ -129,7 +133,7 @@ class CommitsTests(BaseTestCase):
self.assertEqual(output.exit_code, 254)
def test_lint_staged_stdin(self):
- """Tests linting a staged commit. Gitint should lint the passed commit message andfetch additional meta-data
+ """Tests linting a staged commit. Gitint should lint the passed commit message and fetch additional meta-data
from the underlying repository. The easiest way to test this is by inspecting `--debug` output.
This is the equivalent of doing:
echo "WIP: Pïpe test." | gitlint --staged --debug