mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 15:38:59 +08:00
Fix tests
This commit is contained in:
parent
577365cf96
commit
84080b675b
@ -104,10 +104,11 @@ def test_variantNodeInit_excludedMaterial(container_registry, machine_node):
|
|||||||
def test_materialAdded(container_registry, machine_node, metadata, material_result_list):
|
def test_materialAdded(container_registry, machine_node, metadata, material_result_list):
|
||||||
variant_node = createVariantNode("machine_1", machine_node, container_registry)
|
variant_node = createVariantNode("machine_1", machine_node, container_registry)
|
||||||
machine_node.exclude_materials = ["material_3"]
|
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("UM.Settings.ContainerRegistry.ContainerRegistry.getInstance", MagicMock(return_value = container_registry)):
|
||||||
with patch.dict(metadata_dict, metadata):
|
with patch("cura.Machines.VariantNode.MaterialNode"): # We're not testing the material node here, so patch it out.
|
||||||
mocked_container = createMockedInstanceContainer()
|
with patch.dict(metadata_dict, metadata):
|
||||||
variant_node._materialAdded(mocked_container)
|
mocked_container = createMockedInstanceContainer()
|
||||||
|
variant_node._materialAdded(mocked_container)
|
||||||
|
|
||||||
assert len(material_result_list) == len(variant_node.materials)
|
assert len(material_result_list) == len(variant_node.materials)
|
||||||
for name in material_result_list:
|
for name in material_result_list:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user