def run_failure_test(self, fm_mock):
        """Test InstallFlatpakTask.run failure"""
        fm_instance = fm_mock.return_value
        fm_instance.install_all.side_effect = PayloadInstallationError

        with TemporaryDirectory() as temp:
            with self.assertRaises(PayloadInstallationError):
                task = InstallFlatpaksTask(temp)
                task.run()
    def run_success_test(self, fm_mock):
        """Test InstallFlatpakTask.run success"""
        fm_instance = fm_mock.return_value

        with TemporaryDirectory() as temp:
            task = InstallFlatpaksTask(temp)
            task.run()

        fm_instance.install_all.assert_called_once()
        fm_instance.add_remote.assert_called_once()
        fm_instance.remove_remote.assert_called_once()
예제 #3
0
 def _flatpak_install(self):
     from pyanaconda.modules.payloads.payload.rpm_ostree.flatpak_installation import \
         InstallFlatpaksTask
     task = InstallFlatpaksTask(conf.target.system_root)
     task.progress_changed_signal.connect(self._progress_cb)
     task.run()