mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-21 05:37:50 -06:00
Let test_setMaterialByIdExists use new container registry functionality
It sets the container it expects beforehand and tests for its ID. Contributes to issue CURA-3497.
This commit is contained in:
parent
361b58f49c
commit
27f053ad7b
1 changed files with 3 additions and 8 deletions
|
@ -321,15 +321,10 @@ def test_setDefinitionByIdDoesntExist(extruder_stack):
|
||||||
extruder_stack.setDefinitionById("some_definition") #Container registry is empty now.
|
extruder_stack.setDefinitionById("some_definition") #Container registry is empty now.
|
||||||
|
|
||||||
## Tests setting materials by specifying an ID of a material that exists.
|
## Tests setting materials by specifying an ID of a material that exists.
|
||||||
@pytest.mark.skip
|
|
||||||
def test_setMaterialByIdExists(extruder_stack, container_registry):
|
def test_setMaterialByIdExists(extruder_stack, container_registry):
|
||||||
original_container_registry = UM.Settings.ContainerStack._containerRegistry
|
container_registry.return_value = getInstanceContainer(container_type = "material")
|
||||||
UM.Settings.ContainerStack._containerRegistry = container_registry #Always has all the profiles you ask of.
|
extruder_stack.setMaterialById("InstanceContainer")
|
||||||
|
assert extruder_stack.material.getId() == "InstanceContainer"
|
||||||
extruder_stack.setMaterialById("some_material") #The container registry always has a container with the ID.
|
|
||||||
|
|
||||||
#Restore.
|
|
||||||
UM.Settings.ContainerStack._containerRegistry = original_container_registry
|
|
||||||
|
|
||||||
## Tests setting materials by specifying an ID of a material that doesn't
|
## Tests setting materials by specifying an ID of a material that doesn't
|
||||||
# exist.
|
# exist.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue