From dcc28a9a987457acf9e2c8249a9df5e40143eba3 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 11 Mar 2023 09:03:07 +0100 Subject: Merging upstream version 0.19.1. Signed-off-by: Daniel Baumann --- qa/test_gitlint.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'qa/test_gitlint.py') diff --git a/qa/test_gitlint.py b/qa/test_gitlint.py index 6c45196..7a04a39 100644 --- a/qa/test_gitlint.py +++ b/qa/test_gitlint.py @@ -1,8 +1,8 @@ -# pylint: disable=too-many-function-args,unexpected-keyword-arg import os -from qa.shell import echo, git, gitlint + from qa.base import BaseTestCase -from qa.utils import DEFAULT_ENCODING +from qa.shell import echo, git, gitlint +from qa.utils import FILE_ENCODING class IntegrationTests(BaseTestCase): @@ -58,7 +58,7 @@ class IntegrationTests(BaseTestCase): self.assertEqualStdout(output, expected) # Make a small modification to the commit and commit it using fixup commit - with open(os.path.join(self.tmp_git_repo, test_filename), "a", encoding=DEFAULT_ENCODING) as fh: + with open(os.path.join(self.tmp_git_repo, test_filename), "a", encoding=FILE_ENCODING) as fh: fh.write("Appending söme stuff\n") git("add", test_filename, _cwd=self.tmp_git_repo) @@ -87,7 +87,7 @@ class IntegrationTests(BaseTestCase): self.assertEqualStdout(output, expected) # Make a small modification to the commit and commit it using fixup=amend commit - with open(os.path.join(self.tmp_git_repo, test_filename), "a", encoding=DEFAULT_ENCODING) as fh: + with open(os.path.join(self.tmp_git_repo, test_filename), "a", encoding=FILE_ENCODING) as fh: fh.write("Appending söme stuff\n") git("add", test_filename, _cwd=self.tmp_git_repo) @@ -133,7 +133,7 @@ class IntegrationTests(BaseTestCase): self.assertEqualStdout(output, expected) # Make a small modification to the commit and commit it using squash commit - with open(os.path.join(self.tmp_git_repo, test_filename), "a", encoding=DEFAULT_ENCODING) as fh: + with open(os.path.join(self.tmp_git_repo, test_filename), "a", encoding=FILE_ENCODING) as fh: # Wanted to write a unicode string, but that's obnoxious if you want to do it across Python 2 and 3. # https://stackoverflow.com/questions/22392377/ # error-writing-a-file-with-file-write-in-python-unicodeencodeerror @@ -252,7 +252,7 @@ class IntegrationTests(BaseTestCase): binary_filename = self.create_simple_commit("Sïmple commit", file_contents=bytes([0x48, 0x00, 0x49, 0x00])) output = gitlint( "--debug", - _ok_code=1, + _ok_code=[1], _cwd=self.tmp_git_repo, ) -- cgit v1.2.3