mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-09-12 11:49:55 +00:00
refactor: fix pylint warnings in tests
This commit is contained in:
@ -48,7 +48,7 @@ def test_multisearch_single(aur_package_ahriman: AURPackage, pacman: Pacman, moc
|
||||
search_mock.assert_called_once_with("ahriman", pacman=pacman)
|
||||
|
||||
|
||||
def test_remote_git_url(remote: Remote, pacman: Pacman) -> None:
|
||||
def test_remote_git_url(remote: Remote) -> None:
|
||||
"""
|
||||
must raise NotImplemented for missing remote git url
|
||||
"""
|
||||
@ -56,7 +56,7 @@ def test_remote_git_url(remote: Remote, pacman: Pacman) -> None:
|
||||
remote.remote_git_url("package", "repositorys")
|
||||
|
||||
|
||||
def test_remote_web_url(remote: Remote, pacman: Pacman) -> None:
|
||||
def test_remote_web_url(remote: Remote) -> None:
|
||||
"""
|
||||
must raise NotImplemented for missing remote web url
|
||||
"""
|
||||
|
@ -1,10 +1,10 @@
|
||||
import importlib
|
||||
import sys
|
||||
|
||||
import ahriman.core.auth.helpers as helpers
|
||||
|
||||
from pytest_mock import MockerFixture
|
||||
|
||||
from ahriman.core.auth import helpers
|
||||
|
||||
|
||||
def test_import_aiohttp_security() -> None:
|
||||
"""
|
||||
|
@ -27,7 +27,7 @@ def test_changes(mocker: MockerFixture) -> None:
|
||||
diff_mock.assert_called_once_with(local, last_commit_sha)
|
||||
|
||||
|
||||
def test_changes_skip(package_ahriman: Package, mocker: MockerFixture) -> None:
|
||||
def test_changes_skip(mocker: MockerFixture) -> None:
|
||||
"""
|
||||
must return none in case if commit sha is not available
|
||||
"""
|
||||
|
@ -19,7 +19,7 @@ def test_migrate(connection: Connection, configuration: Configuration, mocker: M
|
||||
run_mock.assert_called_once_with()
|
||||
|
||||
|
||||
def test_migration(migrations: Migrations, connection: Connection) -> None:
|
||||
def test_migration(migrations: Migrations) -> None:
|
||||
"""
|
||||
must perform single migration
|
||||
"""
|
||||
|
@ -22,10 +22,7 @@ def test_package_update(database: SQLite, configuration: Configuration, package_
|
||||
patch2 = PkgbuildPatch("key", "value")
|
||||
local = Path("local")
|
||||
|
||||
mocker.patch(
|
||||
"pathlib.Path.is_file",
|
||||
autospec=True,
|
||||
side_effect=lambda p: True if p == Path(".gitignore") else False)
|
||||
mocker.patch("pathlib.Path.is_file", autospec=True, side_effect=lambda p: p == Path(".gitignore"))
|
||||
glob_mock = mocker.patch("pathlib.Path.glob", return_value=[Path(".git"), Path(".gitignore")])
|
||||
rmtree_mock = mocker.patch("shutil.rmtree")
|
||||
unlink_mock = mocker.patch("pathlib.Path.unlink")
|
||||
|
@ -29,7 +29,7 @@ def test_load_archives(package_ahriman: Package, package_python_schedule: Packag
|
||||
assert len(packages) == 2
|
||||
assert {package.base for package in packages} == {package_ahriman.base, package_python_schedule.base}
|
||||
|
||||
archives = sum([list(package.packages.keys()) for package in packages], start=[])
|
||||
archives = sum((list(package.packages.keys()) for package in packages), start=[])
|
||||
assert len(archives) == 3
|
||||
expected = set(package_ahriman.packages.keys())
|
||||
expected.update(package_python_schedule.packages.keys())
|
||||
|
@ -56,7 +56,7 @@ def test_configuration_schema_empty(configuration: Configuration) -> None:
|
||||
assert ReportTrigger.configuration_schema(repository_id, None) == ReportTrigger.CONFIGURATION_SCHEMA
|
||||
|
||||
|
||||
def test_configuration_schema_variables(configuration: Configuration) -> None:
|
||||
def test_configuration_schema_variables() -> None:
|
||||
"""
|
||||
must return empty schema
|
||||
"""
|
||||
|
@ -147,7 +147,7 @@ def test_on_result_exception(trigger_loader: TriggerLoader, package_ahriman: Pac
|
||||
log_mock.assert_called_once()
|
||||
|
||||
|
||||
def test_on_start(trigger_loader: TriggerLoader, package_ahriman: Package, mocker: MockerFixture) -> None:
|
||||
def test_on_start(trigger_loader: TriggerLoader, mocker: MockerFixture) -> None:
|
||||
"""
|
||||
must run triggers on start
|
||||
"""
|
||||
@ -187,7 +187,7 @@ def test_on_stop_without_on_start(configuration: Configuration, mocker: MockerFi
|
||||
on_stop_mock.assert_not_called()
|
||||
|
||||
|
||||
def test_on_stop(trigger_loader: TriggerLoader, package_ahriman: Package, mocker: MockerFixture) -> None:
|
||||
def test_on_stop(trigger_loader: TriggerLoader, mocker: MockerFixture) -> None:
|
||||
"""
|
||||
must run triggers on stop
|
||||
"""
|
||||
|
Reference in New Issue
Block a user