Просмотр исходного кода

Fix unit test

CuraContainerRegistry::load now has a dependency on the ContainerStack
so we need to account for it in our mocks.
Arjen Hiemstra 7 лет назад
Родитель
Сommit
51b76acc6d
1 измененных файлов с 4 добавлено и 1 удалено
  1. 4 1
      tests/Settings/TestCuraContainerRegistry.py

+ 4 - 1
tests/Settings/TestCuraContainerRegistry.py

@@ -77,7 +77,10 @@ def test_loadLegacyFileRenamed(container_registry):
     def findContainers(container_type = 0, id = None):
         if id == "MachineLegacy":
             return None
-        return [UM.Settings.ContainerRegistry._EmptyInstanceContainer(id)]
+
+        container = UM.Settings.ContainerRegistry._EmptyInstanceContainer(id)
+        container.getNextStack = unittest.mock.MagicMock()
+        return [container]
 
     old_find_containers = container_registry.findContainers
     container_registry.findContainers = findContainers