From 9970e36dbd1b249ba11570efeab3d3ed40b1f89d Mon Sep 17 00:00:00 2001 From: Daniel Garcia Moreno Date: Thu, 26 Sep 2024 10:12:12 +0200 Subject: [PATCH] test: Fix flake8 issues --- rpmlint/checks/DocCheck.py | 2 -- test/mockdata/mock_doc.py | 2 ++ test/mockdata/mock_logrotate.py | 2 -- test/test_binaries.py | 2 +- test/test_build_date.py | 2 +- test/test_doc.py | 6 +++--- test/test_files.py | 36 ++++++++++++++++----------------- test/test_i18n.py | 2 +- test/test_logrotate.py | 4 ++-- test/test_menuxdg.py | 2 +- test/test_pkgconfig.py | 2 +- test/test_shlib_policy.py | 2 +- test/test_tmp_files.py | 4 ++-- test/test_zypp_syntax.py | 2 +- 14 files changed, 34 insertions(+), 36 deletions(-) diff --git a/rpmlint/checks/DocCheck.py b/rpmlint/checks/DocCheck.py index 091d9cada..94189f4ce 100644 --- a/rpmlint/checks/DocCheck.py +++ b/rpmlint/checks/DocCheck.py @@ -1,9 +1,7 @@ from pathlib import Path import stat -import rpm from rpmlint.checks.AbstractCheck import AbstractCheck -from rpmlint.helpers import byte_to_string class DocCheck(AbstractCheck): diff --git a/test/mockdata/mock_doc.py b/test/mockdata/mock_doc.py index 545b716a2..11ed3ee0e 100644 --- a/test/mockdata/mock_doc.py +++ b/test/mockdata/mock_doc.py @@ -1,5 +1,7 @@ import stat + import rpm + from Testing import get_tested_mock_package diff --git a/test/mockdata/mock_logrotate.py b/test/mockdata/mock_logrotate.py index 3ccb995b0..d4ac94bb1 100644 --- a/test/mockdata/mock_logrotate.py +++ b/test/mockdata/mock_logrotate.py @@ -1,7 +1,5 @@ import stat -from rpm import RPMFILE_CONFIG, RPMFILE_NOREPLACE - from Testing import get_tested_mock_package diff --git a/test/test_binaries.py b/test/test_binaries.py index f72b02816..466d52a49 100644 --- a/test/test_binaries.py +++ b/test/test_binaries.py @@ -1,5 +1,5 @@ -import pytest from mockdata.mock_pkgconfig import LibReiserFSCoreDevelPackage +import pytest from rpmlint.checks.BinariesCheck import BinariesCheck from rpmlint.filter import Filter diff --git a/test/test_build_date.py b/test/test_build_date.py index 3b4016429..c31e4f551 100644 --- a/test/test_build_date.py +++ b/test/test_build_date.py @@ -1,7 +1,7 @@ import re -from mockdata.mock_build_date import BuildDatePackage from mockdata.mock_bashisms import BashismsPackage +from mockdata.mock_build_date import BuildDatePackage import pytest from rpmlint.checks.BuildRootAndDateCheck import BuildRootAndDateCheck from rpmlint.filter import Filter diff --git a/test/test_doc.py b/test/test_doc.py index fe03e5bc3..88475ea9d 100644 --- a/test/test_doc.py +++ b/test/test_doc.py @@ -1,13 +1,13 @@ -import pytest from mockdata.mock_doc import ( - MyDocPackage, DocFileDependencyPackage, InstallFileInDocPackage, + MyDocPackage, ) +import pytest from rpmlint.checks.DocCheck import DocCheck from rpmlint.filter import Filter -from Testing import CONFIG, get_tested_package +from Testing import CONFIG @pytest.fixture(scope='function', autouse=True) diff --git a/test/test_files.py b/test/test_files.py index dbd03999e..54716c90e 100644 --- a/test/test_files.py +++ b/test/test_files.py @@ -1,28 +1,28 @@ import re from mockdata.mock_files import ( - UnexpandedMacroFilesPackage, - Python3PowerPackage, - Python3PowerBrokenPackage, - TestDocumentationPackage, - NetmaskDebugsourcePackage, - MakefileJunkPackage, - SphinxInvPackage, - FileChecksPackage, - TclPackage, - RustFilesPackage, - ManPagesPackage, DevelopmentPackage, - Shlib1Package, - Shlib2DevelPackage, - FileZeroLengthPackage, - ManualPagesPackage, - PythonShebangLinkPackage, - PythonShebangLinkOkPackage, - DirectoryWithoutXPermPackage, DirectoryWithoutXPerm2Package, + DirectoryWithoutXPermPackage, + FileChecksPackage, FilesWithoutPermsPackage, FilesWithoutPermsTmpfilesPackage, + FileZeroLengthPackage, + MakefileJunkPackage, + ManPagesPackage, + ManualPagesPackage, + NetmaskDebugsourcePackage, + Python3PowerBrokenPackage, + Python3PowerPackage, + PythonShebangLinkOkPackage, + PythonShebangLinkPackage, + RustFilesPackage, + Shlib1Package, + Shlib2DevelPackage, + SphinxInvPackage, + TclPackage, + TestDocumentationPackage, + UnexpandedMacroFilesPackage, ) import pytest from rpmlint.checks.FilesCheck import FilesCheck diff --git a/test/test_i18n.py b/test/test_i18n.py index 822e3c41a..d86b4f435 100644 --- a/test/test_i18n.py +++ b/test/test_i18n.py @@ -1,4 +1,4 @@ -from mockdata.mock_i18n import InvalidI18NPackage, I18NPackage +from mockdata.mock_i18n import I18NPackage, InvalidI18NPackage import pytest from rpmlint.checks.I18NCheck import I18NCheck from rpmlint.filter import Filter diff --git a/test/test_logrotate.py b/test/test_logrotate.py index a94413fa2..55976c406 100644 --- a/test/test_logrotate.py +++ b/test/test_logrotate.py @@ -1,9 +1,9 @@ -import pytest from mockdata.mock_logrotate import LogrotatePackage +import pytest from rpmlint.checks.LogrotateCheck import LogrotateCheck from rpmlint.filter import Filter -from Testing import CONFIG, get_tested_package +from Testing import CONFIG @pytest.fixture(scope='function', autouse=True) diff --git a/test/test_menuxdg.py b/test/test_menuxdg.py index 95633e0e6..95f3aa7a8 100644 --- a/test/test_menuxdg.py +++ b/test/test_menuxdg.py @@ -1,9 +1,9 @@ from mockdata.mock_menuxdg import ( - MenuXDGInvalidPackage, MenuXDGBadBinPackage, MenuXDGBadDupPackage, MenuXDGBadSecPackage, MenuXDGBadUTF8Package, + MenuXDGInvalidPackage, MenuXDGPackage, ) import pytest diff --git a/test/test_pkgconfig.py b/test/test_pkgconfig.py index 3b2b8db03..b801d5ccd 100644 --- a/test/test_pkgconfig.py +++ b/test/test_pkgconfig.py @@ -1,4 +1,4 @@ -from mockdata.mock_pkgconfig import PCPackage, LibReiserFSCoreDevelPackage +from mockdata.mock_pkgconfig import LibReiserFSCoreDevelPackage, PCPackage import pytest from rpmlint.checks.PkgConfigCheck import PkgConfigCheck from rpmlint.filter import Filter diff --git a/test/test_shlib_policy.py b/test/test_shlib_policy.py index 1ef0200db..45560928d 100644 --- a/test/test_shlib_policy.py +++ b/test/test_shlib_policy.py @@ -1,6 +1,6 @@ from mockdata.mock_shlib_policy import ( - LibslpMissingSuffixPackage, Libslp1234Package, + LibslpMissingSuffixPackage, Libtest1Package, ) import pytest diff --git a/test/test_tmp_files.py b/test/test_tmp_files.py index fdbf6702c..efc417a2f 100644 --- a/test/test_tmp_files.py +++ b/test/test_tmp_files.py @@ -1,7 +1,7 @@ from mockdata.mock_tmp_files import ( - TempfiledPackage, - SystemdTempfilesPackage, SystemdTempfilesOkPackage, + SystemdTempfilesPackage, + TempfiledPackage, ) import pytest from rpmlint.checks.TmpFilesCheck import TmpFilesCheck diff --git a/test/test_zypp_syntax.py b/test/test_zypp_syntax.py index 76cf08b58..ab7afab9b 100644 --- a/test/test_zypp_syntax.py +++ b/test/test_zypp_syntax.py @@ -1,6 +1,6 @@ from mockdata.mock_zypp_syntax import ( - SyntaxPackageandPackage, SyntaxAndPackage, + SyntaxPackageandPackage, ) import pytest from rpmlint.checks.ZyppSyntaxCheck import ZyppSyntaxCheck