Files
AnyImage/tests/support/nodes.py
nan f48bbb3d05 Add tests for image layer, image plane, inventory, saved layout, commands, documentation, manifest, and packaging
- Implement tests for image layer functionality including alpha curve and depth layer behavior.
- Create tests for image plane evaluation and modifier input handling.
- Add tests to verify the saved asset inventory and its persistence.
- Introduce tests for the documentation command to ensure correct project version deployment.
- Validate the extension manifest structure and required permissions.
- Develop tests for the packaging process, ensuring correct platform handling and dependency management.
- Enhance image depth plane group functionality with new split threshold input and surface processing.
2026-09-09 22:18:59 +08:00

23 lines
1.2 KiB
Python

"""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)