Fix testing ID of mock-definitions

This isn't the best solution because all definitions now have to get the ID 'some_definition', but it's the best that I could come up with so far.

Contributes to issue CURA-3497.
This commit is contained in:
Ghostkeeper 2017-03-23 15:46:11 +01:00
parent 610d2ae1e6
commit 8a3ab6d289
No known key found for this signature in database
GPG Key ID: C5F96EE2BC0F7E75

View File

@ -28,7 +28,9 @@ def findSomeContainers(container_id = "*", container_type = None, type = None, c
if container_id.startswith("some_"):
return UM.Settings.ContainerRegistry._EmptyInstanceContainer(container_id)
if container_type == DefinitionContainer:
return unittest.mock.MagicMock()
definition_mock = unittest.mock.MagicMock()
definition_mock.getId = unittest.mock.MagicMock(return_value = "some_definition") #getId returns some_definition.
return definition_mock
## Helper function to read the contents of a container stack in the test
# stack folder.