mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-04-24 15:27:17 +00:00
skip update process if no update supplied
This commit is contained in:
parent
c2685f4746
commit
581401d60f
@ -211,6 +211,8 @@ class Application:
|
|||||||
:param updates: list of packages to update
|
:param updates: list of packages to update
|
||||||
"""
|
"""
|
||||||
def process_update(paths: Iterable[Path]) -> None:
|
def process_update(paths: Iterable[Path]) -> None:
|
||||||
|
if not paths:
|
||||||
|
return # don't need to process if no update supplied
|
||||||
updated = [Package.load(path, self.repository.pacman, self.repository.aur_url) for path in paths]
|
updated = [Package.load(path, self.repository.pacman, self.repository.aur_url) for path in paths]
|
||||||
self.repository.process_update(paths)
|
self.repository.process_update(paths)
|
||||||
self._finalize(updated)
|
self._finalize(updated)
|
||||||
|
@ -299,5 +299,5 @@ def test_update(application: Application, package_ahriman: Package, mocker: Mock
|
|||||||
|
|
||||||
application.update([package_ahriman])
|
application.update([package_ahriman])
|
||||||
build_mock.assert_called_once()
|
build_mock.assert_called_once()
|
||||||
update_mock.assert_has_calls([mock.call([]), mock.call(paths)])
|
update_mock.assert_called_with(paths)
|
||||||
finalize_mock.assert_has_calls([mock.call([]), mock.call([package_ahriman])])
|
finalize_mock.assert_called_with([package_ahriman])
|
||||||
|
Loading…
Reference in New Issue
Block a user