fix: material test by splitting it in a gpencil and nodal material test
This commit is contained in:
parent
8865556229
commit
f56890128e
@ -7,13 +7,12 @@ import bpy
|
|||||||
from multi_user.bl_types.bl_material import BlMaterial
|
from multi_user.bl_types.bl_material import BlMaterial
|
||||||
|
|
||||||
|
|
||||||
def test_material(clear_blend):
|
def test_material_nodes(clear_blend):
|
||||||
nodes_types = [node.bl_rna.identifier for node in bpy.types.ShaderNode.__subclasses__()]
|
nodes_types = [node.bl_rna.identifier for node in bpy.types.ShaderNode.__subclasses__()]
|
||||||
|
|
||||||
datablock = bpy.data.materials.new("test")
|
datablock = bpy.data.materials.new("test")
|
||||||
datablock.use_nodes = True
|
datablock.use_nodes = True
|
||||||
bpy.data.materials.create_gpencil_data(datablock)
|
|
||||||
|
|
||||||
for ntype in nodes_types:
|
for ntype in nodes_types:
|
||||||
datablock.node_tree.nodes.new(ntype)
|
datablock.node_tree.nodes.new(ntype)
|
||||||
|
|
||||||
@ -26,3 +25,18 @@ def test_material(clear_blend):
|
|||||||
result = implementation._dump(test)
|
result = implementation._dump(test)
|
||||||
|
|
||||||
assert not DeepDiff(expected, result)
|
assert not DeepDiff(expected, result)
|
||||||
|
|
||||||
|
|
||||||
|
def test_material_gpencil(clear_blend):
|
||||||
|
datablock = bpy.data.materials.new("test")
|
||||||
|
bpy.data.materials.create_gpencil_data(datablock)
|
||||||
|
|
||||||
|
implementation = BlMaterial()
|
||||||
|
expected = implementation._dump(datablock)
|
||||||
|
bpy.data.materials.remove(datablock)
|
||||||
|
|
||||||
|
test = implementation._construct(expected)
|
||||||
|
implementation._load(expected, test)
|
||||||
|
result = implementation._dump(test)
|
||||||
|
|
||||||
|
assert not DeepDiff(expected, result)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user