-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔧 Adiciona 'task_definition.json' ao .gitignore
✨ (prepare.py): Adiciona a funcionalidade de salvar a resposta da definição de tarefa em 'task_definition.json' ✨ (start.py): Adiciona a funcionalidade de ler a definição de tarefa de 'task_definition.json' e usar o 'flow_definition_ref_id' para iniciar a instância de fluxo
- Loading branch information
1 parent
a76a91c
commit 00ea5a3
Showing
3 changed files
with
15 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
integration/task_definition.json | ||
coverage.out | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
|
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 |
---|---|---|
@@ -1,16 +1,24 @@ | ||
""" | ||
This script is used to start a flow instance. | ||
""" | ||
import os | ||
import json | ||
|
||
from utils import client | ||
|
||
if not os.path.exists("task_definition.json"): | ||
raise Exception("task_definition.json not found") | ||
|
||
with open("task_definition.json", "r") as f: | ||
task_definition_data = json.load(f) | ||
|
||
flow_instance_data = { | ||
"input_data": { | ||
"id": 1, | ||
}, | ||
} | ||
|
||
flow_definition_ref_id = "f29c8333-2e2e-4690-90e1-aa86fdaa78ef" | ||
flow_definition_ref_id = task_definition_data["flow_definition_ref_id"] | ||
|
||
response_flow_instance = client().post(f"/flows/instances/{flow_definition_ref_id}/start", json=flow_instance_data) | ||
assert response_flow_instance.status_code == 201 |