Ejemplo n.º 1
0
 def test_job_outputs_path_creation_deletion(self):
     job = JobFactory()
     stores.create_job_outputs_path(persistence=job.persistence_outputs,
                                    job_name=job.unique_name)
     job_outputs_path = stores.get_job_outputs_path(
         persistence=job.persistence_outputs, job_name=job.unique_name)
     assert os.path.exists(job_outputs_path) is True
     stores_schedule_outputs_deletion(persistence='outputs',
                                      subpath=job.subpath)
     assert os.path.exists(job_outputs_path) is False
Ejemplo n.º 2
0
 def test_experiment_outputs_path_creation_deletion(self):
     experiment_outputs_path = stores.get_experiment_outputs_path(
         persistence=self.experiment.persistence_outputs,
         experiment_name=self.experiment.unique_name)
     assert os.path.exists(experiment_outputs_path) is False
     stores.create_experiment_outputs_path(
         persistence=self.experiment.persistence_outputs,
         experiment_name=self.experiment.unique_name)
     assert os.path.exists(experiment_outputs_path) is True
     stores_schedule_outputs_deletion(persistence=None, subpath=self.experiment.subpath)
     assert os.path.exists(experiment_outputs_path) is False
Ejemplo n.º 3
0
 def test_experiment_group_outputs_path_creation_deletion(self):
     experiment = ExperimentFactory(user=self.project.user,
                                    project=self.project,
                                    experiment_group=self.experiment_group)
     stores.create_experiment_outputs_path(
         persistence=experiment.persistence_outputs,
         experiment_name=experiment.unique_name)
     experiment_outputs_path = stores.get_experiment_outputs_path(
         persistence=experiment.persistence_outputs,
         experiment_name=experiment.unique_name)
     experiment_group_outputs_path = stores.get_experiment_group_outputs_path(
         persistence=self.experiment_group.persistence_outputs,
         experiment_group_name=self.experiment_group.unique_name)
     assert os.path.exists(experiment_outputs_path) is True
     assert os.path.exists(experiment_group_outputs_path) is True
     stores_schedule_outputs_deletion(persistence=None, subpath=self.experiment_group.subpath)
     assert os.path.exists(experiment_outputs_path) is False
     assert os.path.exists(experiment_group_outputs_path) is False
Ejemplo n.º 4
0
 def test_project_outputs_path_creation_deletion(self):
     with patch('scheduler.tasks.experiments.experiments_build.apply_async'
                ) as _:  # noqa
         experiment = ExperimentFactory(user=self.project.user,
                                        project=self.project)
     stores.create_experiment_outputs_path(
         persistence=experiment.persistence_outputs,
         experiment_name=experiment.unique_name)
     experiment_outputs_path = stores.get_experiment_outputs_path(
         persistence=experiment.persistence_outputs,
         experiment_name=experiment.unique_name)
     project_outputs_path = stores.get_project_outputs_path(
         persistence=None, project_name=self.project.unique_name)
     assert os.path.exists(experiment_outputs_path) is True
     assert os.path.exists(project_outputs_path) is True
     stores_schedule_outputs_deletion(persistence='outputs',
                                      subpath=self.project.subpath)
     assert os.path.exists(experiment_outputs_path) is False
     assert os.path.exists(project_outputs_path) is False