Fix tests

CURA-7835
This commit is contained in:
Jaime van Kessel 2020-12-18 11:52:53 +01:00
parent 037b5d5b44
commit cd76326fed
No known key found for this signature in database
GPG key ID: 3710727397403C91

View file

@ -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