diff options
| author | Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> | 2026-09-10 16:42:30 -0400 |
|---|---|---|
| committer | Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> | 2026-09-10 16:42:30 -0400 |
| commit | b529bc1f0d6a5418cb60ebc6c127796aba08068e (patch) | |
| tree | b04b95e0174ffd4f5d0a194188ff73bed9e8c5fd | |
| parent | 4e5d7eb600a094d6f52bd915814de85ea6735836 (diff) | |
| download | decky-lsfg-vk-b529bc1f0d6a5418cb60ebc6c127796aba08068e.tar.gz decky-lsfg-vk-b529bc1f0d6a5418cb60ebc6c127796aba08068e.zip | |
test: cover flatpak profile uninstall cleanup
| -rw-r--r-- | tests/test_plugin_migration.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/test_plugin_migration.py b/tests/test_plugin_migration.py index ab036b0..824cbf6 100644 --- a/tests/test_plugin_migration.py +++ b/tests/test_plugin_migration.py @@ -51,17 +51,35 @@ class PluginMigrationTests(unittest.TestCase): finally: self._restore(previous_decky, previous_tomllib) - def test_uninstall_cleans_owned_flatpak_state(self): + def test_uninstall_cleans_owned_flatpak_state_and_profiles(self): Plugin, _decky, previous_decky, previous_tomllib = self._load_plugin() try: plugin = Plugin.__new__(Plugin) plugin.installation_service = Mock() plugin.flatpak_service = Mock() + plugin.configuration_service = Mock() plugin.flatpak_service.remove_plugin_owned_environment.return_value = {"success": True} asyncio.run(plugin._uninstall()) plugin.flatpak_service.remove_plugin_owned_environment.assert_called_once_with() + plugin.configuration_service.reset_all_flatpak_configs.assert_called_once_with() + plugin.installation_service.cleanup_on_uninstall.assert_called_once_with() + finally: + self._restore(previous_decky, previous_tomllib) + + def test_uninstall_preserves_profiles_when_flatpak_cleanup_fails(self): + Plugin, _decky, previous_decky, previous_tomllib = self._load_plugin() + try: + plugin = Plugin.__new__(Plugin) + plugin.installation_service = Mock() + plugin.flatpak_service = Mock() + plugin.configuration_service = Mock() + plugin.flatpak_service.remove_plugin_owned_environment.return_value = {"success": False, "error": "changed"} + + asyncio.run(plugin._uninstall()) + + plugin.configuration_service.reset_all_flatpak_configs.assert_not_called() plugin.installation_service.cleanup_on_uninstall.assert_called_once_with() finally: self._restore(previous_decky, previous_tomllib) |
