-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a simple pipeline unit test without mara db (#71)
add a simple pipeline unit test without mara db
- Loading branch information
1 parent
5fc9aff
commit 4ec05ed
Showing
4 changed files
with
67 additions
and
5 deletions.
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
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
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
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,26 @@ | ||
import pytest | ||
|
||
from mara_app.monkey_patch import patch | ||
|
||
import mara_db.config | ||
patch(mara_db.config.databases)(lambda: {}) | ||
|
||
|
||
def test_execute_without_db(): | ||
from mara_pipelines.commands.python import RunFunction | ||
from mara_pipelines.pipelines import Pipeline, Task | ||
from mara_pipelines.ui.cli import run_pipeline | ||
|
||
pipeline = Pipeline( | ||
id='test_execute_without_db', | ||
description="Tests if a pipeline can be executed without database") | ||
|
||
def command_function() -> bool: | ||
return True | ||
|
||
pipeline.add( | ||
Task(id='run_python_function', | ||
description="Runs a sample python function", | ||
commands=[RunFunction(function=command_function)])) | ||
|
||
assert run_pipeline(pipeline) |