mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-11-29 08:25:10 +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:
1 parent
ad2908630c
commit
3b1eba216a
2 files changed
+5
-3
No files matched your search
+3
-1
@@ -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)
|
||||
])
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user