Skip to content

Commit 9ff82f0

Browse files
author
Alan Christie
committed
test: Extend test for options
1 parent 6b1e3b0 commit 9ff82f0

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

tests/test_workflow_validator_for_create_level.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,3 +122,25 @@ def test_validate_simple_python_molprops():
122122
# Assert
123123
assert error.error_num == 0
124124
assert error.error_msg is None
125+
126+
127+
def test_validate_simple_python_molprops_with_options():
128+
# Arrange
129+
workflow_file: str = os.path.join(
130+
os.path.dirname(__file__),
131+
"workflow-definitions",
132+
"simple-python-molprops-with-options.yaml",
133+
)
134+
with open(workflow_file, "r", encoding="utf8") as workflow_file:
135+
workflow: dict[str, Any] = yaml.load(workflow_file, Loader=yaml.FullLoader)
136+
assert workflow
137+
138+
# Act
139+
error = WorkflowValidator.validate(
140+
level=ValidationLevel.CREATE,
141+
workflow_definition=workflow,
142+
)
143+
144+
# Assert
145+
assert error.error_num == 0
146+
assert error.error_msg is None

tests/test_workflow_validator_for_tag_level.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,28 @@ def test_validate_simple_python_molprops():
129129
assert error.error_msg is None
130130

131131

132+
def test_validate_simple_python_molprops_with_options():
133+
# Arrange
134+
workflow_file: str = os.path.join(
135+
os.path.dirname(__file__),
136+
"workflow-definitions",
137+
"simple-python-molprops-with-options.yaml",
138+
)
139+
with open(workflow_file, "r", encoding="utf8") as workflow_file:
140+
workflow: dict[str, Any] = yaml.load(workflow_file, Loader=yaml.FullLoader)
141+
assert workflow
142+
143+
# Act
144+
error = WorkflowValidator.validate(
145+
level=ValidationLevel.TAG,
146+
workflow_definition=workflow,
147+
)
148+
149+
# Assert
150+
assert error.error_num == 0
151+
assert error.error_msg is None
152+
153+
132154
def test_validate_duplicate_workflow_variable_names():
133155
# Arrange
134156
workflow_file: str = os.path.join(

0 commit comments

Comments
 (0)