Skip to content

Commit 0c60799

Browse files
author
Alan Christie
committed
feat: Add get_running_workflow_step_output_values_for_output() to API
1 parent 1d22716 commit 0c60799

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

tests/test_test_api_adapter.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,21 @@ def test_get_running_workflow_step_by_name():
443443
assert response["id"] == rwfs_id
444444

445445

446+
def test_basic_get_running_workflow_step_output_values_for_output_when_step_unknown():
447+
# Arrange
448+
utaa = UnitTestWorkflowAPIAdapter()
449+
450+
# Act
451+
response, _ = utaa.get_running_workflow_step_output_values_for_output(
452+
running_workflow_step_id="r-workflow-step-00000000-0000-0000-0000-000000000001",
453+
output="outputFile",
454+
)
455+
456+
# Assert
457+
assert "outputs" in response
458+
assert len(response["outputs"]) == 0
459+
460+
446461
def test_basic_realise():
447462
# Arrange
448463
utaa = UnitTestWorkflowAPIAdapter()

tests/wapi_adapter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ def get_running_workflow_steps(self, *, running_workflow_id: str) -> dict[str, A
390390
steps.append(item)
391391
return {"count": len(steps), "running_workflow_steps": steps}
392392

393-
def get_running_workflow_step_outputs(
393+
def get_running_workflow_step_output_values_for_output(
394394
self, *, running_workflow_step_id: str, output: str
395395
) -> tuple[dict[str, Any], int]:
396396
del running_workflow_step_id

workflow/workflow_abc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,16 +349,16 @@ def get_job(
349349
# If not present an empty dictionary should be returned.
350350

351351
@abstractmethod
352-
def get_running_workflow_step_outputs(
352+
def get_running_workflow_step_output_values_for_output(
353353
self, *, running_workflow_step_id: str, output: str
354354
) -> tuple[dict[str, Any], int]:
355-
"""Gets the set of outputs for the output variable of a given step.
355+
"""Gets the set of outputs generated for the output variable of a given step.
356356
The step must have stopped for this to return any meaningful value.
357357
Returned files might also include paths that are relative to the
358358
Step's instance directory."""
359359
# Should return a (possibly empty) list of paths and filenames:
360360
# {
361-
# "outputs": ["file1.sdf", "file2.sdf"]
361+
# "outputs": ["dir/file1.sdf", "dir/file2.sdf"]
362362
# }
363363

364364
@abstractmethod

0 commit comments

Comments
 (0)