Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions tests/modules/lint/test_main_nf.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,38 @@ def test_get_outputs_no_partial_keyword_match(tmp_path):
assert '"*{3prime,5prime,trimmed,val}{,_1,_2}.fq.gz"' in list(component.outputs["reads"][0][1].keys())


def test_get_outputs_no_partial_keyword_match_in_emit_name(tmp_path):
"""Test that output parsing does not match val inside emit names like peak_values"""
main_nf_content = """
process TEST_PROCESS {
input:
val(meta)

output:
path "*peak_values.nii.gz", emit: peak_values

script:
"echo test"
}
"""
main_nf_path = tmp_path / "main.nf"
main_nf_path.write_text(main_nf_content)

component = NFCoreComponent(
component_name="test",
repo_url=None,
component_dir=tmp_path,
repo_type="modules",
base_dir=tmp_path,
component_type="modules",
remote_component=False,
)

component.get_outputs_from_main_nf()

assert component.outputs == {"peak_values": [{'"*peak_values.nii.gz"': {"_keyword": "path"}}]}


def test_get_outputs_complete_version_command(tmp_path):
"""Test that the version command is complete with both eval() and val()"""
main_nf_content = """
Expand Down
Loading