def test_evaluate_directive_valid_job(self, available_directives_list, non_default_directive_values): _tmp_dir = TemporaryDirectory(prefix="flow-directives_") FlowProject.init_project(name="DirectivesTest", root=_tmp_dir.name) project = FlowProject.get_project(root=_tmp_dir.name) for i in range(5): project.open_job(dict(i=i)).init() valid_values = non_default_directive_values[0] valid_values["processor_fraction"] = lambda job: round( job.sp.i / 10, 1) for job in project: directives = _Directives(available_directives_list) directives.update( {"processor_fraction": lambda job: round(job.sp.i / 10, 1)}) directives.evaluate((job, )) assert directives["processor_fraction"] == round(job.sp.i / 10, 1)
def setUp(self): MockScheduler.reset() self._tmp_dir = TemporaryDirectory(prefix='signac-flow_') self.addCleanup(self._tmp_dir.cleanup) self.project = FlowProject.init_project(name='FlowTestProject', root=self._tmp_dir.name)