Browse Source

Fix tests

CURA-7835
Jaime van Kessel 4 years ago
parent
commit
cd76326fed
1 changed files with 5 additions and 1 deletions
  1. 5 1
      tests/TestBuildVolume.py

+ 5 - 1
tests/TestBuildVolume.py

@@ -66,9 +66,12 @@ class TestCalculateBedAdhesionSize:
             return properties.get(args[2])
 
     def createAndSetGlobalStack(self, build_volume):
-        mocked_stack = MagicMock()
+        mocked_stack = MagicMock(name = "mocked_stack")
         mocked_stack.getProperty = MagicMock(side_effect=self.getPropertySideEffect)
+        mocked_extruder = MagicMock(name = "mocked_extruder")
+        mocked_extruder.getProperty = MagicMock(side_effect=self.getPropertySideEffect)
 
+        mocked_stack.extruderList = [mocked_extruder]
         build_volume._global_container_stack = mocked_stack
 
     def test_noGlobalStack(self, build_volume: BuildVolume):
@@ -90,6 +93,7 @@ class TestCalculateBedAdhesionSize:
         self.createAndSetGlobalStack(build_volume)
         patched_dictionary = self.setting_property_dict.copy()
         patched_dictionary.update(setting_dict)
+        patched_dictionary.update({"adhesion_extruder_nr": {"value": 0}})
         with patch.dict(self.setting_property_dict, patched_dictionary):
             assert build_volume._calculateBedAdhesionSize([]) == result