def set_up_with_tasks(self): """Set up the installation source. :return: list of tasks required for the source setup :rtype: [Task] """ task = SetUpRepoFilesSourceTask(REPO_DIRS) return [task]
def test_setup_install_source_task_failure(self): with TemporaryDirectory() as temp_dir_name: with pytest.raises(SourceSetupError) as cm: SetUpRepoFilesSourceTask([temp_dir_name]).run() assert str(cm.value) == "repo files not found"
def test_setup_install_source_task_success(self): with TemporaryDirectory() as temp_dir_name: open(os.path.join(temp_dir_name, "somefile.repo"), "w").close() SetUpRepoFilesSourceTask([temp_dir_name]).run()
def test_setup_install_source_task_name(self): """Test Repo files Source setup installation source task name.""" task = SetUpRepoFilesSourceTask([""]) assert task.name == "Set up Repo files Installation Source"
def setup_install_source_task_failure_test(self): with TemporaryDirectory() as temp_dir_name: with self.assertRaises(SourceSetupError, msg="repo files not found"): SetUpRepoFilesSourceTask([temp_dir_name]).run()
def setup_install_source_task_name_test(self): """Test Repo files Source setup installation source task name.""" task = SetUpRepoFilesSourceTask([""]) self.assertEqual(task.name, "Set up Repo files Installation Source")