Skip to content

Commit

Permalink
test(workflows): WDL path fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
davidlougheed committed Nov 20, 2023
1 parent 3e98e61 commit b770083
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/test_workflows.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
import pytest
from pathlib import Path

from bento_lib import workflows

WDL_DIR = Path(__file__).parent / "wdls"


def test_namespaced_input():
assert workflows.utils.namespaced_input("workflow1", "input") == "workflow1.input"


def test_workflow_set():
ws = workflows.workflow_set.WorkflowSet()
ws = workflows.workflow_set.WorkflowSet(WDL_DIR)

assert not ws.workflow_exists("test")
assert ws.get_workflow("test") is None
Expand All @@ -28,6 +31,7 @@ def test_workflow_set():
assert ws.workflow_exists("test")
assert ws.get_workflow("test") == wd
assert ws.get_workflow_resource("test") == "test.wdl"
assert ws.get_workflow_wdl_path("test") == WDL_DIR / "test.wdl"

assert ws.workflow_dicts_by_type_and_id()["ingestion"]["test"]["name"] == "Test Workflow"
assert ws.workflow_dicts_by_id()["test"]["name"] == "Test Workflow"
Expand All @@ -41,11 +45,13 @@ def test_workflow_set():
description="A test workflow",
data_type="experiment",
tags=["experiment", "cbioportal"],
file="test.wdl",
file="test2.wdl",
inputs=[
workflows.models.WorkflowStringInput(id="input1", type="string"),
]
)

ws.add_workflow("test2", wd2)
assert ws.workflow_exists("test2")

assert ws.get_workflow_wdl_path("test3") is None # no test3 workflow
11 changes: 11 additions & 0 deletions tests/wdls/test.wdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version 1.0

workflow test {
input {
File f
}

output {
File f_out = f
}
}

0 comments on commit b770083

Please sign in to comment.