From de139943d8272773b5f19ed824d687b0232b9ba3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 11 Mar 2023 09:03:03 +0100 Subject: Adding upstream version 0.19.1. Signed-off-by: Daniel Baumann --- qa/test_commits.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'qa/test_commits.py') 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 , + 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 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 -- cgit v1.2.3