-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: execute_pipeline_activity.py defaults back to empty parameters i…
…f none were supplied
- Loading branch information
Showing
2 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
tests/unit/models/activities/test_execute_pipeline_activity_parameters.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
from data_factory_testing_framework.models.activities.execute_pipeline_activity import ExecutePipelineActivity | ||
from data_factory_testing_framework.models.data_factory_element import DataFactoryElement | ||
from data_factory_testing_framework.state import PipelineRunState, RunParameter, RunParameterType | ||
|
||
|
||
def test_execute_pipeline_activity_evaluates_parameters() -> None: | ||
# Arrange | ||
execute_pipeline_activity = ExecutePipelineActivity( | ||
name="ExecutePipelineActivity", | ||
typeProperties={ | ||
"parameters": { | ||
"url": DataFactoryElement("@pipeline().parameters.param1"), | ||
}, | ||
}, | ||
depends_on=[], | ||
) | ||
state = PipelineRunState( | ||
parameters=[ | ||
RunParameter(name="param1", value="value1", parameter_type=RunParameterType.Pipeline), | ||
], | ||
) | ||
|
||
# Act | ||
activity = execute_pipeline_activity.evaluate(state) | ||
|
||
# Assert | ||
assert activity is not None | ||
assert activity.name == "ExecutePipelineActivity" | ||
assert activity.parameters["url"].value == "value1" | ||
|
||
|
||
def test_execute_pipeline_activity_evaluates_no_parameters() -> None: | ||
# Arrange | ||
execute_pipeline_activity = ExecutePipelineActivity( | ||
name="ExecutePipelineActivity", | ||
typeProperties={}, | ||
depends_on=[], | ||
) | ||
state = PipelineRunState() | ||
|
||
# Act | ||
activity = execute_pipeline_activity.evaluate(state) | ||
|
||
# Assert | ||
assert activity is not None | ||
assert activity.name == "ExecutePipelineActivity" | ||
assert activity.parameters == {} |