Ejemplo n.º 1
0
    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]
Ejemplo n.º 2
0
    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"
Ejemplo n.º 3
0
 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()
Ejemplo n.º 4
0
 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")