mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-10 07:39:01 +08:00
Mock the limit_to_extruder property with an actual value
This is necessary because our code now converts this to an integer. Mocks can't be converted to an integer, so the sub-magic-mock here can't be used. We need to provide something that can be cast to an integer.
This commit is contained in:
parent
825a34d418
commit
93c84d5bc0
@ -24,6 +24,11 @@ def setting_override_decorator():
|
||||
|
||||
|
||||
def test_onSettingValueChanged(setting_override_decorator):
|
||||
def mock_getRawProperty(key, property_name, *args, **kwargs):
|
||||
if property_name == "limit_to_extruder":
|
||||
return "-1"
|
||||
return MagicMock(name="rawProperty")
|
||||
container_registry.findContainerStacks().__getitem__().getRawProperty = mock_getRawProperty
|
||||
# On creation the needs slicing should be called once (as it being added should trigger a reslice)
|
||||
assert application.getBackend().needsSlicing.call_count == 1
|
||||
with patch("UM.Application.Application.getInstance", MagicMock(return_value=application)):
|
||||
|
Loading…
x
Reference in New Issue
Block a user