mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-07-31 22:59:55 +00:00
refactor: fix pylint warnings in tests
This commit is contained in:
@ -100,7 +100,7 @@ def test_add_local_cache(application_packages: ApplicationPackages, package_ahri
|
||||
"""
|
||||
mocker.patch("ahriman.models.package.Package.from_build", return_value=package_ahriman)
|
||||
mocker.patch("pathlib.Path.is_dir", autospec=True,
|
||||
side_effect=lambda p: True if p.is_relative_to(application_packages.repository.paths.cache) else False)
|
||||
side_effect=lambda p: p.is_relative_to(application_packages.repository.paths.cache))
|
||||
init_mock = mocker.patch("ahriman.core.build_tools.sources.Sources.init")
|
||||
copytree_mock = mocker.patch("shutil.copytree")
|
||||
build_queue_mock = mocker.patch("ahriman.core.database.SQLite.build_queue_insert")
|
||||
|
@ -47,7 +47,7 @@ def test_iter(updates_iterator: UpdatesIterator) -> None:
|
||||
"""
|
||||
must return self as iterator
|
||||
"""
|
||||
assert updates_iterator.__iter__() == updates_iterator
|
||||
assert iter(updates_iterator) == updates_iterator
|
||||
|
||||
|
||||
def test_next(updates_iterator: UpdatesIterator, package_ahriman: Package, mocker: MockerFixture) -> None:
|
||||
@ -58,7 +58,7 @@ def test_next(updates_iterator: UpdatesIterator, package_ahriman: Package, mocke
|
||||
side_effect=[([package_ahriman.base], 2), (None, 2), StopIteration])
|
||||
sleep_mock = mocker.patch("time.sleep")
|
||||
|
||||
updates = [packages for packages in updates_iterator]
|
||||
updates = list(updates_iterator)
|
||||
assert updates == [[package_ahriman.base], None]
|
||||
sleep_mock.assert_has_calls([MockCall(0.5), MockCall(0.5)])
|
||||
|
||||
|
@ -156,7 +156,7 @@ def test_configuration_create_ahriman(args: argparse.Namespace, configuration: C
|
||||
|
||||
|
||||
def test_configuration_create_ahriman_no_multilib(args: argparse.Namespace, configuration: Configuration,
|
||||
repository_paths: RepositoryPaths, mocker: MockerFixture) -> None:
|
||||
mocker: MockerFixture) -> None:
|
||||
"""
|
||||
must create configuration for the service without multilib repository
|
||||
"""
|
||||
|
Reference in New Issue
Block a user