From f56890128eb5b0a7082ef9dd974f01f8eb85c66b Mon Sep 17 00:00:00 2001 From: Swann Date: Thu, 15 Oct 2020 18:08:08 +0200 Subject: [PATCH] fix: material test by splitting it in a gpencil and nodal material test --- tests/test_bl_types/test_material.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/tests/test_bl_types/test_material.py b/tests/test_bl_types/test_material.py index 910d4bc..953bae2 100644 --- a/tests/test_bl_types/test_material.py +++ b/tests/test_bl_types/test_material.py @@ -7,13 +7,12 @@ 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)