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.
This commit is contained in:
37
tests/tools/nodes/test_saved_layout.py
Normal file
37
tests/tools/nodes/test_saved_layout.py
Normal file
@@ -0,0 +1,37 @@
|
||||
from tests.support.paths import PROJECT_ROOT
|
||||
import unittest
|
||||
|
||||
|
||||
SOURCE_ROOT = PROJECT_ROOT / "src" / "anyimage"
|
||||
|
||||
|
||||
class NodeAssetsTest(unittest.TestCase):
|
||||
def test_geometry_assets_preserve_node_structure(self):
|
||||
import bpy
|
||||
|
||||
from tests.support.nodes import validate_node_structure
|
||||
from tools.nodes.arrangement.arrange import arrange_nodes
|
||||
|
||||
bpy.ops.wm.read_factory_settings(use_empty=True)
|
||||
with bpy.data.libraries.load(
|
||||
str(SOURCE_ROOT / "assets" / "O_AnyImage.blend")
|
||||
) as (source, target):
|
||||
target.node_groups = list(source.node_groups)
|
||||
groups = [
|
||||
group
|
||||
for group in target.node_groups
|
||||
if group.bl_idname == "GeometryNodeTree"
|
||||
]
|
||||
self.assertEqual(len(groups), 6)
|
||||
for group in groups:
|
||||
validate_node_structure(group)
|
||||
positions = {node.name: tuple(node.location) for node in group.nodes
|
||||
if node.bl_idname not in {"NodeReroute", "NodeGroupInput"}}
|
||||
arrange_nodes(group)
|
||||
for name, position in positions.items():
|
||||
for actual, expected in zip(group.nodes[name].location, position):
|
||||
self.assertAlmostEqual(actual, expected, delta=0.01, msg=f"{group.name}: {name}")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user