Merge branch 'master' into CURA-6793_performance

This commit is contained in:
Ghostkeeper 2019-10-16 15:47:41 +02:00
commit c12817170c
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276
31 changed files with 537 additions and 94 deletions

View file

@ -104,10 +104,11 @@ def test_variantNodeInit_excludedMaterial(container_registry, machine_node):
def test_materialAdded(container_registry, machine_node, metadata, material_result_list):
variant_node = createVariantNode("machine_1", machine_node, container_registry)
machine_node.exclude_materials = ["material_3"]
with patch("cura.Machines.VariantNode.MaterialNode"): # We're not testing the material node here, so patch it out.
with patch.dict(metadata_dict, metadata):
mocked_container = createMockedInstanceContainer()
variant_node._materialAdded(mocked_container)
with patch("UM.Settings.ContainerRegistry.ContainerRegistry.getInstance", MagicMock(return_value = container_registry)):
with patch("cura.Machines.VariantNode.MaterialNode"): # We're not testing the material node here, so patch it out.
with patch.dict(metadata_dict, metadata):
mocked_container = createMockedInstanceContainer()
variant_node._materialAdded(mocked_container)
assert len(material_result_list) == len(variant_node.materials)
for name in material_result_list: