mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 15:44:04 -06: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
1 changed files with 5 additions and 0 deletions
|
@ -24,6 +24,11 @@ def setting_override_decorator():
|
||||||
|
|
||||||
|
|
||||||
def test_onSettingValueChanged(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)
|
# On creation the needs slicing should be called once (as it being added should trigger a reslice)
|
||||||
assert application.getBackend().needsSlicing.call_count == 1
|
assert application.getBackend().needsSlicing.call_count == 1
|
||||||
with patch("UM.Application.Application.getInstance", MagicMock(return_value=application)):
|
with patch("UM.Application.Application.getInstance", MagicMock(return_value=application)):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue