mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 17:59:00 +08:00
Add tests for changing properties on specified containers
Other than just user, that is. Contributes to issue CURA-3497.
This commit is contained in:
parent
319fd929d8
commit
55dd17cae7
@ -408,4 +408,33 @@ def test_setNextStack(global_stack):
|
|||||||
])
|
])
|
||||||
def test_setPropertyUser(key, property, value, output_value, global_stack):
|
def test_setPropertyUser(key, property, value, output_value, global_stack):
|
||||||
global_stack.setProperty(key, value, property)
|
global_stack.setProperty(key, value, property)
|
||||||
assert global_stack.userChanges.getProperty(key, property) == output_value
|
assert global_stack.userChanges.getProperty(key, property) == output_value
|
||||||
|
|
||||||
|
## Tests setting properties on specific containers on the global stack.
|
||||||
|
@pytest.mark.parametrize("target_container", [
|
||||||
|
"user",
|
||||||
|
"quality_changes",
|
||||||
|
"quality",
|
||||||
|
"material",
|
||||||
|
"variant",
|
||||||
|
"definition_changes",
|
||||||
|
"definition"
|
||||||
|
])
|
||||||
|
def test_setPropertyOtherContainers(target_container, global_stack):
|
||||||
|
#Other parameters that don't need to be varied.
|
||||||
|
key = "layer_height"
|
||||||
|
property = "value",
|
||||||
|
value = "0.1337",
|
||||||
|
output_value = 0.1337
|
||||||
|
|
||||||
|
global_stack.setProperty(key, value, property, target_container = target_container)
|
||||||
|
containers = {
|
||||||
|
"user": global_stack.userChanges,
|
||||||
|
"quality_changes": global_stack.qualityChanges,
|
||||||
|
"quality": global_stack.quality,
|
||||||
|
"material": global_stack.material,
|
||||||
|
"variant": global_stack.variant,
|
||||||
|
"definition_changes": global_stack.definition_changes,
|
||||||
|
"definition": global_stack.definition
|
||||||
|
}
|
||||||
|
assert containers[target_container].getProperty(key, property) == output_value
|
Loading…
x
Reference in New Issue
Block a user