Skip to content

Commit

Permalink
add in unknown parsing for WFTypes (#653)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathanjp91 authored Sep 7, 2023
1 parent 3173988 commit a4bc974
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions darwin/future/data_objects/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ class WFType(Enum):
ARCHIVE = "archive"
CONSENSUS_TEST = "consensus_test"
CONSENSUS_ENTRYPOINT = "consensus_entrypoint"
UNKNOWN = "unknown"

@classmethod
def _missing_(cls, value: str) -> "WFType":
return WFType.UNKNOWN


class WFUser(DefaultDarwin):
Expand Down
5 changes: 5 additions & 0 deletions darwin/future/tests/meta/queries/test_stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ def multi_stage_workflow_object(base_single_workflow_object: dict) -> dict:
return base_single_workflow_object


def test_WFTypes_accept_unknonwn() -> None:
assert WFType("unknown") == WFType.UNKNOWN
assert WFType("test") == WFType.UNKNOWN


def test_stage_collects_basic(
filled_query: StageQuery, base_single_workflow_object: dict, base_workflow_meta: WorkflowMeta
) -> None:
Expand Down

0 comments on commit a4bc974

Please sign in to comment.