def test_get_pipeline_name_inferred(self): """ Script implies pipeline name if it's not explicitly configured. """ pipeline_names = ["wgbs", "atacseq"] for extensions in itertools.combinations(EXTENSIONS, 2): pipelines = [ name + ext for name, ext in zip(pipeline_names, extensions) ] pi_config_data = {pipeline: None for pipeline in pipelines} with mock.patch("looper.models.PipelineInterface._expand_paths"): pi = PipelineInterface(pi_config_data) for expected_name, pipeline in zip(pipeline_names, pipelines): assert expected_name == pi.get_pipeline_name(pipeline)
def test_get_pipeline_name_explicit(self, name_and_ext_pairs): """ Configuration can directly specify pipeline name. """ names, extensions = zip(*name_and_ext_pairs) pipelines = [name + ext for name, ext in name_and_ext_pairs] pi_conf_data = { pipeline: { "name": name } for pipeline, name in zip(pipelines, names) } pi = PipelineInterface(pi_conf_data) for pipeline, expected_name in zip(pipelines, names): assert expected_name == pi.get_pipeline_name(pipeline)