Ejemplo n.º 1
0
 def install_with_no_tasks_test(self):
     """Install with no tasks."""
     self._set_up_task(SystemInstallationTask([]))
     self._check_steps(0)
     self._run_task()
     self._finish_task()
     self._check_no_result()
Ejemplo n.º 2
0
    def install_system_with_task(self):
        """Install the system.

        :return: an instance of the main installation task
        """
        installation_tasks = self._collect_installation_tasks()
        system_task = SystemInstallationTask(installation_tasks)
        return system_task
Ejemplo n.º 3
0
 def install_with_canceled_task_test(self):
     """Install with one canceled task."""
     self._set_up_task(
         SystemInstallationTask([TaskInterface(self.CanceledTask())]))
     self._check_steps(1)
     self._run_and_cancel_task()
     self._finish_task()
     self._check_progress_changed(1, "Canceled Task")
Ejemplo n.º 4
0
 def install_with_failing_task_test(self):
     """Install with one failing task."""
     self._set_up_task(
         SystemInstallationTask([TaskInterface(self.FailingTask())]))
     self._check_steps(1)
     self._run_task()
     self._finish_failed_task()
     self._check_progress_changed(1, "Failing Task")
Ejemplo n.º 5
0
 def install_with_one_task_test(self):
     """Install with one task."""
     self._set_up_task(
         SystemInstallationTask([TaskInterface(self.SimpleTask())]))
     self._check_steps(1)
     self._run_task()
     self._finish_task()
     self._check_progress_changed(1, "Simple Task")
Ejemplo n.º 6
0
    def install_with_three_tasks_test(self):
        """Install with three tasks."""
        self._set_up_task(
            SystemInstallationTask([
                TaskInterface(self.InstallationTaskA()),
                TaskInterface(self.InstallationTaskB()),
                TaskInterface(self.InstallationTaskC())
            ]))
        self._check_steps(3)
        self._run_task()
        self._finish_task()

        self.progress_changed_callback.assert_has_calls(
            [call(1, "Install A"),
             call(2, "Install B"),
             call(3, "Install C")])
Ejemplo n.º 7
0
    def install_with_incomplete_tasks_test(self):
        """Install with incomplete tasks."""
        self._set_up_task(
            SystemInstallationTask([
                TaskInterface(self.InstallationTaskA()),
                TaskInterface(self.IncompleteTask()),
                TaskInterface(self.InstallationTaskB()),
                TaskInterface(self.InstallationTaskC())
            ]))
        self._check_steps(8)
        self._run_task()
        self._finish_task()

        self.progress_changed_callback.assert_has_calls([
            call(1, "Install A"),
            call(2, "Install incomplete task"),  # plus 5
            call(7, "Install B"),
            call(8, "Install C")
        ])