Skip to content

feat: Support Optional samplesheet parameters #475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
Next Next commit
test: cover non-samplesheet types
  • Loading branch information
msto committed Jul 19, 2024
commit ede1b0ba9c8100f6b320f3f57c43bae0705b9de2
9 changes: 9 additions & 0 deletions tests/resources/test_workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ def test_is_valid_samplesheet_parameter_type(dtype: TypeAnnotation) -> None:
assert _is_valid_samplesheet_parameter_type(parameter) is True


@pytest.mark.parametrize("dtype", PRIMITIVE_TYPES + COLLECTION_TYPES + OPTIONAL_TYPES)
def test_is_valid_samplesheet_parameter_type_rejects_invalid_types(dtype: TypeAnnotation) -> None:
"""
`_is_valid_samplesheet_parameter_type` should reject any other type.
"""
parameter = inspect.Parameter("foo", kind=inspect.Parameter.POSITIONAL_OR_KEYWORD, annotation=dtype)
assert _is_valid_samplesheet_parameter_type(parameter) is False


def test_is_list_of_dataclasses_type() -> None:
"""
`_is_list_of_dataclasses_type` should accept a type that is a list of dataclasses.
Expand Down