refacotr: collection test
This commit is contained in:
@ -2,7 +2,7 @@ import os
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
from deepdiff import DeepDiff
|
from deepdiff import DeepDiff
|
||||||
|
from uuid import uuid4
|
||||||
import bpy
|
import bpy
|
||||||
import random
|
import random
|
||||||
from multi_user.bl_types.bl_collection import BlCollection
|
from multi_user.bl_types.bl_collection import BlCollection
|
||||||
@ -10,8 +10,13 @@ from multi_user.bl_types.bl_collection import BlCollection
|
|||||||
def test_collection(clear_blend):
|
def test_collection(clear_blend):
|
||||||
# Generate a collection with childrens and a cube
|
# Generate a collection with childrens and a cube
|
||||||
datablock = bpy.data.collections.new("root")
|
datablock = bpy.data.collections.new("root")
|
||||||
datablock.children.link(bpy.data.collections.new("child"))
|
datablock.uuid = str(uuid4())
|
||||||
datablock.children.link(bpy.data.collections.new("child2"))
|
s1 = bpy.data.collections.new("child")
|
||||||
|
s1.uuid = str(uuid4())
|
||||||
|
s2 = bpy.data.collections.new("child2")
|
||||||
|
s2.uuid = str(uuid4())
|
||||||
|
datablock.children.link(s1)
|
||||||
|
datablock.children.link(s2)
|
||||||
|
|
||||||
bpy.ops.mesh.primitive_cube_add()
|
bpy.ops.mesh.primitive_cube_add()
|
||||||
datablock.objects.link(bpy.data.objects[0])
|
datablock.objects.link(bpy.data.objects[0])
|
||||||
|
Reference in New Issue
Block a user