Fix test_setMaterialByIdExists

It now also uses the return_value construct.

Contributes to issue CURA-3497.
This commit is contained in:
Ghostkeeper 2017-04-11 16:43:58 +02:00
parent 546cacec37
commit d652e4564e
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75

View file

@ -516,8 +516,9 @@ def test_setDefinitionChangesByIdDoesntExist(global_stack):
## Tests setting materials by specifying an ID of a material that exists. ## Tests setting materials by specifying an ID of a material that exists.
def test_setMaterialByIdExists(global_stack, container_registry): def test_setMaterialByIdExists(global_stack, container_registry):
container_registry.typeMetaData = "material" container_registry.return_value = getInstanceContainer(container_type = "material")
global_stack.setMaterialById("some_material") #The container registry always has a container with the ID. global_stack.setMaterialById("InstanceContainer")
assert global_stack.material.getId() == "InstanceContainer"
## 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.