Skip to content
Snippets Groups Projects
Commit 8317e93b authored by Bryan Brancotte's avatar Bryan Brancotte
Browse files

transmit output_dir param, add test to prevent regression

parent 28c891c8
No related branches found
No related tags found
1 merge request!5Fix output dir issue
Pipeline #13221 passed with stage
in 45 seconds
...@@ -6,6 +6,7 @@ from . import constant ...@@ -6,6 +6,7 @@ from . import constant
import os import os
import re import re
import json import json
from pathlib import Path
class Workflow: class Workflow:
...@@ -14,7 +15,13 @@ class Workflow: ...@@ -14,7 +15,13 @@ class Workflow:
license = None, creativeWorkStatus = None, authors = None, license = None, creativeWorkStatus = None, authors = None,
version = None, keywords = None, producer = None, version = None, keywords = None, producer = None,
publisher = None): publisher = None):
self.nextflow_file = Nextflow_File(file, duplicate = duplicate, display_info = display_info) self.nextflow_file = Nextflow_File(
file,
duplicate=duplicate,
display_info=display_info,
output_dir=output_dir
)
self.output_dir = Path(output_dir)
self.rocrate = None self.rocrate = None
self.name = name self.name = name
self.datePublished = datePublished self.datePublished = datePublished
......
import pathlib
import unittest
from tempfile import TemporaryDirectory
from bioflow_insight_cli.main import cli
class TestCall(unittest.TestCase):
def test_cli_works(self):
cli("./wf_test/main.nf", render_graphs=True)
cli("./wf_test/main.nf", render_graphs=False)
def test_cli_output_considered(self):
with TemporaryDirectory() as my_temp_dir:
my_results = pathlib.Path(my_temp_dir) / "my_results"
self.assertFalse(my_results.exists())
cli("./wf_test/main.nf", render_graphs=False, output_dir=str(my_results))
self.assertTrue(my_results.exists(), "Results should be there, output_dir not taken into account")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment