Guard against type checking of DefinitionContainer

Otherwise it finds that we're trying to set a MagicMock into the definition slot.

Contributes to issue CURA-3497.
This commit is contained in:
Ghostkeeper 2017-04-07 16:58:47 +02:00
parent 7158ebdaea
commit 16b3c78667
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75

View file

@ -517,7 +517,8 @@ def test_removeContainer(global_stack):
## Tests setting definitions by specifying an ID of a definition that exists.
def test_setDefinitionByIdExists(global_stack, container_registry):
global_stack.setDefinitionById("some_definition") #The container registry always has a container with the ID.
with unittest.mock.patch("cura.Settings.CuraContainerStack.DefinitionContainer", unittest.mock.MagicMock): #To guard against type checking the DefinitionContainer.
global_stack.setDefinitionById("some_definition") #The container registry always has a container with the ID.
## Tests setting definitions by specifying an ID of a definition that doesn't
# exist.