fix: material test by splitting it in a gpencil and nodal material test

This commit is contained in:
Swann 2020-10-15 18:08:08 +02:00
parent 8865556229
commit f56890128e
No known key found for this signature in database
GPG Key ID: E1D3641A7C43AACB

View File

@ -7,12 +7,11 @@ import bpy
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__()]
datablock = bpy.data.materials.new("test")
datablock.use_nodes = True
bpy.data.materials.create_gpencil_data(datablock)
for ntype in nodes_types:
datablock.node_tree.nodes.new(ntype)
@ -26,3 +25,18 @@ def test_material(clear_blend):
result = implementation._dump(test)
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)