fix error with missing sources

In case if package has local cache it will fail to load because no
remote source set. Particially this case can be observed during tree
load
This commit is contained in:
2022-05-08 03:56:54 +03:00
parent 47c578ea08
commit b6db2a8035
11 changed files with 115 additions and 93 deletions

View File

@ -54,8 +54,9 @@ def test_add_aur(application_packages: ApplicationPackages, package_ahriman: Pac
application_packages._add_aur(package_ahriman.base, set(), False)
load_mock.assert_called_once_with(
pytest.helpers.anyvar(int),
package_ahriman.remote,
pytest.helpers.anyvar(int))
package_ahriman,
pytest.helpers.anyvar(int),
application_packages.repository.paths)
dependencies_mock.assert_called_once_with(pytest.helpers.anyvar(int), set(), False)
build_queue_mock.assert_called_once_with(package_ahriman)
update_remote_mock.assert_called_once_with(package_ahriman)

View File

@ -195,7 +195,6 @@ def test_update_empty(application_repository: ApplicationRepository, package_ahr
"""
must skip updating repository if no packages supplied
"""
paths = [package.filepath for package in package_ahriman.packages.values()]
tree = Tree([Leaf(package_ahriman, set())])
mocker.patch("ahriman.core.tree.Tree.load", return_value=tree)