diff options
author | Ghostkeeper <rubend@tutanota.com> | 2020-06-02 15:01:09 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2020-06-02 15:01:09 +0300 |
commit | 93c84d5bc053bd091f007ed77542833b91f195dc (patch) | |
tree | ef7f1ccaaf9bab7f1755f98066fec6117de3cf11 /tests/Settings | |
parent | 825a34d41844236cf65d16aaea5435490b300346 (diff) |
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.
Diffstat (limited to 'tests/Settings')
-rw-r--r-- | tests/Settings/TestSettingOverrideDecorator.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/Settings/TestSettingOverrideDecorator.py b/tests/Settings/TestSettingOverrideDecorator.py index 50c23c409f..4976ce81a7 100644 --- a/tests/Settings/TestSettingOverrideDecorator.py +++ b/tests/Settings/TestSettingOverrideDecorator.py @@ -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)): |