示例#1
0
 def test_download_configs(self, outdir):
     download_obj = DownloadWorkflow(pipeline="nf-core/methylseq",
                                     revision="1.6")
     download_obj.outdir = outdir
     download_obj.download_configs()
     assert os.path.exists(
         os.path.join(outdir, "configs", "nfcore_custom.config"))
示例#2
0
 def test_download_configs(self):
     outdir = tempfile.mkdtemp()
     download_obj = DownloadWorkflow(pipeline="nf-core/methylseq",
                                     release="1.6")
     download_obj.outdir = outdir
     download_obj.download_configs()
     assert os.path.exists(
         os.path.join(outdir, "configs", "nfcore_custom.config"))
示例#3
0
    def test_wf_use_local_configs(self):
        # Get a workflow and configs
        test_outdir = tempfile.mkdtemp()
        download_obj = DownloadWorkflow(pipeline="dummy",
                                        release="1.2.0",
                                        outdir=test_outdir)
        shutil.copytree(PATH_WORKING_EXAMPLE,
                        os.path.join(test_outdir, 'workflow'))
        download_obj.download_configs()

        # Test the function
        download_obj.wf_use_local_configs()
        wf_config = nf_core.utils.fetch_wf_config(
            os.path.join(test_outdir, 'workflow'))
        assert wf_config['params.custom_config_base'] == "'../configs/'"
示例#4
0
    def test_wf_use_local_configs(self):
        # Get a workflow and configs
        test_pipeline_dir = os.path.join(tempfile.mkdtemp(),
                                         "nf-core-testpipeline")
        create_obj = nf_core.create.PipelineCreate("testpipeline",
                                                   "This is a test pipeline",
                                                   "Test McTestFace",
                                                   outdir=test_pipeline_dir)
        create_obj.init_pipeline()

        test_outdir = tempfile.mkdtemp()
        download_obj = DownloadWorkflow(pipeline="dummy",
                                        release="1.2.0",
                                        outdir=test_outdir)
        shutil.copytree(test_pipeline_dir,
                        os.path.join(test_outdir, "workflow"))
        download_obj.download_configs()

        # Test the function
        download_obj.wf_use_local_configs()
        wf_config = nf_core.utils.fetch_wf_config(
            os.path.join(test_outdir, "workflow"))
        assert wf_config["params.custom_config_base"] == "'../configs/'"
示例#5
0
    def test_wf_use_local_configs(self, tmp_path):
        # Get a workflow and configs
        test_pipeline_dir = os.path.join(tmp_path, "nf-core-testpipeline")
        create_obj = nf_core.create.PipelineCreate("testpipeline",
                                                   "This is a test pipeline",
                                                   "Test McTestFace",
                                                   outdir=test_pipeline_dir)
        create_obj.init_pipeline()

        with tempfile.TemporaryDirectory() as test_outdir:
            download_obj = DownloadWorkflow(pipeline="dummy",
                                            revision="1.2.0",
                                            outdir=test_outdir)
            shutil.copytree(test_pipeline_dir,
                            os.path.join(test_outdir, "workflow"))
            download_obj.download_configs()

            # Test the function
            download_obj.wf_use_local_configs()
            wf_config = nf_core.utils.fetch_wf_config(os.path.join(
                test_outdir, "workflow"),
                                                      cache_config=False)
            assert wf_config[
                "params.custom_config_base"] == f"'{test_outdir}/workflow/../configs/'"
示例#6
0
 def test_download_configs(self):
     download_obj = DownloadWorkflow(pipeline="dummy",
                                     release="1.2.0",
                                     outdir=tempfile.mkdtemp())
     download_obj.download_configs()