Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorArjen Hiemstra <ahiemstra@heimr.nl>2017-05-04 14:04:21 +0300
committerArjen Hiemstra <ahiemstra@heimr.nl>2017-05-04 14:06:34 +0300
commitfe112d5d81f82d89859387494e33c7e742486204 (patch)
tree3e9cbb61dd5494aeb04c2cc12a99642131119d74 /tests
parent45a369e31b1ff9b18a76b5349a47099397da0de3 (diff)
Fix extruderstack test on CI
We do not need a complete CuraApplication just so registerExtruder can work. Instead, we just mock away the extruder manager so the rest of the test can proceed.
Diffstat (limited to 'tests')
-rw-r--r--tests/Settings/TestExtruderStack.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/Settings/TestExtruderStack.py b/tests/Settings/TestExtruderStack.py
index b52f71e02d..4e55411d9d 100644
--- a/tests/Settings/TestExtruderStack.py
+++ b/tests/Settings/TestExtruderStack.py
@@ -11,7 +11,7 @@ from UM.Settings.InstanceContainer import InstanceContainer #To check against th
import cura.Settings.ExtruderStack #The module we're testing.
from cura.Settings.Exceptions import InvalidContainerError, InvalidOperationError #To check whether the correct exceptions are raised.
-from cura.CuraApplication import CuraApplication
+from cura.Settings.ExtruderManager import ExtruderManager
## Fake container registry that always provides all containers you ask of.
@pytest.yield_fixture()
@@ -241,7 +241,9 @@ def test_deserializeMoveDefinitionContainer(extruder_stack):
## Tests whether getProperty properly applies the stack-like behaviour on its
# containers.
def test_getPropertyFallThrough(extruder_stack):
- CuraApplication.getInstance() # To ensure that we have the right Application
+ # ExtruderStack.setNextStack calls registerExtruder for backward compatibility, but we do not need a complete extruder manager
+ ExtruderManager._ExtruderManager__instance = unittest.mock.MagicMock()
+
#A few instance container mocks to put in the stack.
mock_layer_heights = {} #For each container type, a mock container that defines layer height to something unique.
mock_no_settings = {} #For each container type, a mock container that has no settings at all.