Ajustes conforme relatorio de testes 2026-08-27

This commit is contained in:
2026-08-29 09:53:32 -03:00
parent 0ecff719b7
commit 88e1f070d7
791 changed files with 27040 additions and 29038 deletions

View File

@@ -0,0 +1,39 @@
from pathlib import Path
import yaml
from app.domain.contas.workflow_actions import build_contas_workflow_actions
def test_invoice_explanation_sim_final_node_declares_final_response():
spec = yaml.safe_load(Path("workflows/invoice_explanation.v2.yaml").read_text(encoding="utf-8"))
nodes = {node["id"]: node for node in spec["nodes"]}
cfg = nodes["registrar_protocolo_aceite"]["input"]
assert cfg["workflow_response_final"] is True
assert "{protocol}" in cfg["mensagem_final"]
def test_protocol_action_can_materialize_workflow_final_response(monkeypatch):
class Client:
def abrir_protocolo(self, payload):
return {"interactionProtocol": "1234567890", "status": "OPENED"}
class Service:
client = Client()
registry = build_contas_workflow_actions(Service())
action = registry.get("registrar_protocolo_inicio")
result = action(
{
"msisdn": "11999999999",
"scenario": "invoice_explanation_aceite_fechado",
"request_status": "Fechado",
"status": "CLOSED",
"workflow_response_final": True,
"mensagem_final": "Seu número de protocolo é {protocol}.",
},
{"input": {}},
)
assert result["workflow_response_final"] is True
assert result["protocol_number"]
assert result["mensagem"] == f"Seu número de protocolo é {result['protocol_number']}."