mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-11 23:59:03 +08:00
Add test for setProperty to set properties on user changes
Contributes to issue CURA-3497.
This commit is contained in:
parent
eeb84ac27b
commit
319fd929d8
@ -396,4 +396,16 @@ def test_removeContainer(global_stack):
|
||||
## Tests whether changing the next stack is properly forbidden.
|
||||
def test_setNextStack(global_stack):
|
||||
with pytest.raises(InvalidOperationError):
|
||||
global_stack.setNextStack(unittest.mock.MagicMock())
|
||||
global_stack.setNextStack(unittest.mock.MagicMock())
|
||||
|
||||
## Tests setting properties directly on the global stack.
|
||||
@pytest.mark.parametrize("key, property, value, output_value", [
|
||||
("layer_height", "value", "0.1337", 0.1337),
|
||||
("foo", "value", "100", 100),
|
||||
("support_enabled", "value", "True", True),
|
||||
("layer_height", "default_value", 0.1337, 0.1337),
|
||||
("layer_height", "is_bright_pink", "of course", "of course")
|
||||
])
|
||||
def test_setPropertyUser(key, property, value, output_value, global_stack):
|
||||
global_stack.setProperty(key, value, property)
|
||||
assert global_stack.userChanges.getProperty(key, property) == output_value
|
Loading…
x
Reference in New Issue
Block a user