"""Shared assertions and asset selection for node tests.""" from tools.nodes.groups.image_cutout import build_image_cutout_group from tools.nodes.groups.image_depth_cutout import build_image_depth_cutout_group from tools.nodes.groups.image_depth_balloon import build_image_depth_balloon_group CUTOUT_BUILDERS = { "FLAT": build_image_cutout_group, "SOLID": build_image_cutout_group, "DEPTH_SOLID": build_image_depth_cutout_group, "DEPTH_BALLOON": build_image_depth_balloon_group, } def validate_node_structure(node_group): """Check visible sockets, default titles, and paired execution endpoints.""" nodes = [node for node in node_group.nodes if node.bl_idname not in {"NodeReroute", "NodeFrame"}] assert all(not node.label for node in nodes), node_group.name assert not any(node.bl_idname == "FunctionNodeInputString" for node in nodes), node_group.name assert all(socket.is_linked or socket.hide for node in node_group.nodes for socket in node.outputs), node_group.name for node in nodes: if node.bl_idname in {"GeometryNodeRepeatInput", "GeometryNodeSimulationInput", "GeometryNodeForeachGeometryElementInput"}: assert node.paired_output in node_group.nodes.values(), (node_group.name, node.name)