mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
uninstall: Use reverse order when uninstalling components
Tests: - Functional tests for bepasty app work. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
ad2908630c
commit
3b1eba216a
@ -147,7 +147,9 @@ class App:
|
||||
|
||||
def uninstall(self):
|
||||
"""De-configure and uninstall the app."""
|
||||
for component in self.components.values():
|
||||
# Remove components in the reverse order so that dependencies among
|
||||
# components is properly satisfied.
|
||||
for component in reversed(self.components.values()):
|
||||
component.uninstall()
|
||||
|
||||
def get_setup_state(self) -> SetupState:
|
||||
|
||||
@ -264,8 +264,8 @@ def test_packages_uninstall_exclusion(cache, uninstall,
|
||||
TestApp3()
|
||||
app1.uninstall()
|
||||
uninstall.assert_has_calls([
|
||||
call(['package11', 'package3', 'dep6'], purge=True),
|
||||
call(['package12', 'package3'], purge=True)
|
||||
call(['package12', 'package3'], purge=True),
|
||||
call(['package11', 'package3', 'dep6'], purge=True)
|
||||
])
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user