コード例 #1
0
ファイル: payload.py プロジェクト: VladimirSlavik/anaconda
    def _tear_down_additional_sources(self):
        """Tear down sources of additional repositories.

        FIXME: This is a temporary workaround.
        """
        while self._mount_points:
            mount_point = self._mount_points.pop()
            task = TearDownMountTask(mount_point)
            task.run()
コード例 #2
0
    def run_failure_test(self, unmount_mock, ismount_mock):
        """Tear down mount source task failure."""
        task = TearDownMountTask(mount_location)
        with self.assertRaises(SourceTearDownError) as cm:
            task.run()

        self.assertEqual(str(cm.exception), "The mount point /some/dir is still in use.")
        unmount_mock.assert_called_once_with(mount_location)
        ismount_mock.assert_called_once_with(mount_location)
コード例 #3
0
    def test_run_failure(self, unmount_mock, ismount_mock):
        """Tear down mount source task failure."""
        task = TearDownMountTask(mount_location)
        with pytest.raises(SourceTearDownError) as cm:
            task.run()

        assert str(cm.value) == "The mount point /some/dir is still in use."
        unmount_mock.assert_called_once_with(mount_location)
        ismount_mock.assert_called_once_with(mount_location)
コード例 #4
0
    def _tear_down_image(self):
        """Tear down the image after the installation."""
        task = TearDownMountTask(self._iso_mount_point)
        self._run_task(task)

        task = TearDownMountTask(self._image_mount_point)
        self._run_task(task)

        task = RemoveImageTask(self._download_path)
        self._run_task(task)
コード例 #5
0
ファイル: nfs.py プロジェクト: martinpitt/anaconda-1
    def tear_down_with_tasks(self):
        """Tear down the installation source.

        :return: list of tasks required for the source clean-up
        :rtype: [TearDownMountTask]
        """
        tasks = [
            TearDownMountTask(self._iso_mount),
            TearDownMountTask(self._device_mount),
        ]
        return tasks
コード例 #6
0
ファイル: harddrive.py プロジェクト: yugart/anaconda
    def tear_down_with_tasks(self):
        """Tear down the installation source.

        :return: list of tasks required for the source clean-up
        :rtype: [Task]
        """
        tasks = []
        if self._uses_iso_mount:
            tasks.append(TearDownMountTask(self._iso_mount))
        tasks.append(TearDownMountTask(self._device_mount))
        return tasks
コード例 #7
0
    def tear_down_with_tasks(self):
        """Tear down the installation source.

        :return: list of tasks required for the source clean-up
        :rtype: [TearDownMountTask]
        """
        return [TearDownMountTask(target_mount=self.mount_point)]
コード例 #8
0
 def name_test(self):
     """Tear down mount source task name."""
     task = TearDownMountTask(mount_location)
     self.assertEqual(task.name, "Tear down mount installation source")
コード例 #9
0
 def run_success_test(self, unmount_mock):
     """Tear down mount source task execution."""
     task = TearDownMountTask(mount_location)
     task.run()
     unmount_mock.assert_called_once_with(mount_location)
コード例 #10
0
 def test_name(self):
     """Tear down mount source task name."""
     task = TearDownMountTask(mount_location)
     assert task.name == "Tear down mount installation source"