Blender_bevy_components_wor.../tools/blenvy/tests/test_registry.py
kaosat.dev b957f0573b feat(Blenvy): settings coherency pass
* restructured component settings to be used instead of the registry
 * removed settings from registry
 * fixed data access for the above
 * added saving of component parameters
 * added component settings pointer in blenvy core
 * added loading of both auto_export & component settings in blenvy core's load_settings
2024-05-26 18:33:06 +02:00

22 lines
848 B
Python

import bpy
from .setup_data import setup_data
def test_blend(setup_data):
registry = bpy.context.window_manager.components_registry
registry.schema_path = setup_data["components_schemaPath"]
bpy.ops.object.reload_registry()
long_name = "bevy_example::test_components::BasicTest"
add_component_operator = bpy.ops.object.add_bevy_component
add_component_operator(component_type=long_name)
property_group_name = registry.get_propertyGroupName_from_longName(long_name)
object = bpy.context.object
target_components_metadata = object.components_meta.components
component_meta = next(filter(lambda component: component["long_name"] == long_name, target_components_metadata), None)
propertyGroup = getattr(component_meta, property_group_name, None)
assert propertyGroup.field_names == ['a', 'b', 'c']