diff options
Diffstat (limited to 'tests/python/bl_pyapi_idprop_datablock.py')
-rw-r--r-- | tests/python/bl_pyapi_idprop_datablock.py | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/tests/python/bl_pyapi_idprop_datablock.py b/tests/python/bl_pyapi_idprop_datablock.py index 4acfb83bd95..8ff597dda31 100644 --- a/tests/python/bl_pyapi_idprop_datablock.py +++ b/tests/python/bl_pyapi_idprop_datablock.py @@ -61,8 +61,10 @@ class TestClass(bpy.types.PropertyGroup): def get_scene(lib_name, sce_name): for s in bpy.data.scenes: if s.name == sce_name: - if (s.library and s.library.name == lib_name) or \ - (lib_name == None and s.library == None): + if ( + (s.library and s.library.name == lib_name) or + (lib_name is None and s.library is None) + ): return s @@ -88,10 +90,10 @@ def make_lib(): # datablock pointer to the Camera object bpy.data.objects["Cube"].prop = bpy.data.objects['Camera'] - # array of datablock pointers to the Lamp object + # array of datablock pointers to the Light object for i in range(0, arr_len): a = bpy.data.objects["Cube"].prop_array.add() - a.test_prop = bpy.data.objects['Lamp'] + a.test_prop = bpy.data.objects['Light'] a.name = a.test_prop.name # make unique named copy of the cube @@ -122,7 +124,7 @@ def check_lib(): # check array of pointers in duplicated object for i in range(0, arr_len): abort_if_false(bpy.data.objects["Cube.001"].prop_array[i].test_prop == - bpy.data.objects['Lamp']) + bpy.data.objects['Light']) def check_lib_linking(): @@ -135,7 +137,7 @@ def check_lib_linking(): o = bpy.data.scenes["Scene_lib"].objects['Unique_Cube'] - abort_if_false(o.prop_array[0].test_prop == bpy.data.scenes["Scene_lib"].objects['Lamp']) + abort_if_false(o.prop_array[0].test_prop == bpy.data.scenes["Scene_lib"].objects['Light']) abort_if_false(o.prop == bpy.data.scenes["Scene_lib"].objects['Camera']) abort_if_false(o.prop.library == o.library) @@ -185,15 +187,15 @@ def check_scene_copying(): # count users def test_users_counting(): bpy.ops.wm.read_factory_settings() - lamp_us = bpy.data.objects["Lamp"].data.users + Light_us = bpy.data.objects["Light"].data.users n = 1000 for i in range(0, n): - bpy.data.objects["Cube"]["a%s" % i] = bpy.data.objects["Lamp"].data - abort_if_false(bpy.data.objects["Lamp"].data.users == lamp_us + n) + bpy.data.objects["Cube"]["a%s" % i] = bpy.data.objects["Light"].data + abort_if_false(bpy.data.objects["Light"].data.users == Light_us + n) for i in range(0, int(n / 2)): bpy.data.objects["Cube"]["a%s" % i] = 1 - abort_if_false(bpy.data.objects["Lamp"].data.users == lamp_us + int(n / 2)) + abort_if_false(bpy.data.objects["Light"].data.users == Light_us + int(n / 2)) # linking @@ -257,13 +259,13 @@ def test_restrictions1(): bpy.types.Scene.prop2 = bpy.props.PointerProperty(type=bpy.types.NodeTree, poll=poll1) # check poll effect on UI (poll returns false => red alert) - bpy.context.scene.prop = bpy.data.objects["Lamp.001"] - bpy.context.scene.prop1 = bpy.data.objects["Lamp.001"] + bpy.context.scene.prop = bpy.data.objects["Light.001"] + bpy.context.scene.prop1 = bpy.data.objects["Light.001"] # check incorrect type assignment def sub_test(): # NodeTree id_prop - bpy.context.scene.prop2 = bpy.data.objects["Lamp.001"] + bpy.context.scene.prop2 = bpy.data.objects["Light.001"] check_crash(sub_test) @@ -309,6 +311,7 @@ def test_restrictions2(): class TestUIList(UIList): test = bpy.props.PointerProperty(type=bpy.types.Object) + def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index): layout.prop(item, "name", text="", emboss=False, icon_value=icon) |