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()
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)
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)
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)
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
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
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)]
def name_test(self): """Tear down mount source task name.""" task = TearDownMountTask(mount_location) self.assertEqual(task.name, "Tear down mount installation source")
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)
def test_name(self): """Tear down mount source task name.""" task = TearDownMountTask(mount_location) assert task.name == "Tear down mount installation source"