From 8a3ab6d289178e0f8d0e7b331f6eac3f4d88882b Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 23 Mar 2017 15:46:11 +0100 Subject: [PATCH] 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. --- tests/Settings/TestGlobalStack.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Settings/TestGlobalStack.py b/tests/Settings/TestGlobalStack.py index ea431d2dad..f624fad329 100644 --- a/tests/Settings/TestGlobalStack.py +++ b/tests/Settings/TestGlobalStack.py @@ -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.