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:
23
tests/tools/nodes/test_inventory.py
Normal file
23
tests/tools/nodes/test_inventory.py
Normal file
@@ -0,0 +1,23 @@
|
||||
"""Check the saved library's public inventory and persistence."""
|
||||
import bpy
|
||||
from anyimage.common.node import load_node_group, node_asset_path
|
||||
from tools.nodes.check import GEOMETRY_NAMES, SHADER_NAMES
|
||||
|
||||
|
||||
def test_saved_asset_inventory():
|
||||
bpy.ops.wm.read_factory_settings(use_empty=True)
|
||||
with bpy.data.libraries.load(str(node_asset_path())) as (source, _):
|
||||
assert set(source.node_groups) == GEOMETRY_NAMES | SHADER_NAMES
|
||||
for name in sorted(GEOMETRY_NAMES | SHADER_NAMES):
|
||||
bpy.ops.wm.read_factory_settings(use_empty=True)
|
||||
node_group = load_node_group(name)
|
||||
assert node_group.bl_idname == ("GeometryNodeTree" if name in GEOMETRY_NAMES else "ShaderNodeTree")
|
||||
assert node_group.use_fake_user and node_group.users > 0
|
||||
if name in GEOMETRY_NAMES:
|
||||
assert node_group.is_modifier
|
||||
if bpy.app.version >= (5, 0, 0):
|
||||
assert node_group.library is not None
|
||||
if name in {"O Image Depth Layer", "O Shadeless"}:
|
||||
expected = ["Color", "Alpha", "Depth", "Bump Scale"] if name == "O Image Depth Layer" else ["Color"]
|
||||
assert [item.name for item in node_group.interface.items_tree
|
||||
if item.item_type == "SOCKET" and item.in_out == "INPUT"] == expected
|
||||
Reference in New Issue
Block a user