3
3
from typing import Union
4
4
from uuid import UUID
5
5
6
+ from tests import common
6
7
from tests .fixtures .valid_flow_json import * # noqa: F401, F403, pylint: disable=wildcard-import,unused-wildcard-import
7
8
from use_case_executor .adapters .flow_validation .edge import Edge
8
9
from use_case_executor .adapters .flow_validation .edge_data .direct_link_data import (
54
55
from use_case_executor .domain .flow .node_data .node_type import NodeType
55
56
56
57
57
- def _string_to_uuid_or_none (value : Optional [str ]) -> Optional [UUID ]:
58
- return UUID (value ) if value is not None else None
59
-
60
-
61
58
def check_answer_node ( # pylint: disable=too-many-locals
62
59
node : Node ,
63
60
node_uuid : UUID ,
@@ -186,7 +183,7 @@ def check_user_input_node(
186
183
assert node .uuid == node_uuid
187
184
user_input_data = node .data
188
185
assert isinstance (user_input_data , UserInputData )
189
- assert user_input_data .variable_uuid == _string_to_uuid_or_none (
186
+ assert user_input_data .variable_uuid == common . string_to_uuid_or_none (
190
187
node_data_dict ["variable_uuid" ]
191
188
)
192
189
assert user_input_data .prompt_translations == node_data_dict ["prompt_translations" ]
@@ -207,7 +204,7 @@ def check_user_input_node(
207
204
)
208
205
assert (
209
206
user_input_data .cancel_quick_reply_go_to_use_case_data .target_use_case_uuid
210
- == _string_to_uuid_or_none (
207
+ == common . string_to_uuid_or_none (
211
208
go_to_use_case_data_dict .get ("target_use_case_uuid" )
212
209
)
213
210
)
@@ -222,7 +219,7 @@ def check_create_ticket_node(node: Node, node_uuid: UUID, node_data_dict: dict)
222
219
assert isinstance (create_ticket_data , CreateTicketData )
223
220
224
221
assert create_ticket_data .agent_channel_uuid == (
225
- _string_to_uuid_or_none (node_data_dict .get ("agent_channel_uuid" ))
222
+ common . string_to_uuid_or_none (node_data_dict .get ("agent_channel_uuid" ))
226
223
)
227
224
228
225
for actual_system_field , system_field in zip (
0 commit comments