Team Ai
Apppublic

Underground-Digital/Workflow-Engine

sourceHugging Faceupdated 2y agoView on Hugging Face
0likes
test_conversation_variable.py27 linesDownload Raw Back to models
1from uuid import uuid42 3from core.variables import SegmentType4from factories import variable_factory5from models import ConversationVariable6 7 8def test_from_variable_and_to_variable():9    variable = variable_factory.build_variable_from_mapping(10        {11            "id": str(uuid4()),12            "name": "name",13            "value_type": SegmentType.OBJECT,14            "value": {15                "key": {16                    "key": "value",17                }18            },19        }20    )21 22    conversation_variable = ConversationVariable.from_variable(23        app_id="app_id", conversation_id="conversation_id", variable=variable24    )25 26    assert conversation_variable.to_variable() == variable27