mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -06: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
1 changed files with 30 additions and 1 deletions
|
@ -408,4 +408,33 @@ def test_setNextStack(global_stack):
|
|||
])
|
||||
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
|
||||
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…
Add table
Add a link
Reference in a new issue