mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 23:17:32 -06:00
Remove unused target_container parameter
It's not compatible with ContainerInterface anyway. Contributes to issue CURA-5330.
This commit is contained in:
parent
a6ffbbde8f
commit
e38228ac24
3 changed files with 8 additions and 57 deletions
|
@ -340,26 +340,4 @@ def test_setPropertyUser(key, property, value, extruder_stack):
|
|||
|
||||
extruder_stack.setProperty(key, property, value) #The actual test.
|
||||
|
||||
extruder_stack.userChanges.setProperty.assert_called_once_with(key, property, value) #Make sure that the user container gets a setProperty call.
|
||||
|
||||
## Tests setting properties on specific containers on the global stack.
|
||||
@pytest.mark.parametrize("target_container, stack_variable", [
|
||||
("user", "userChanges"),
|
||||
("quality_changes", "qualityChanges"),
|
||||
("quality", "quality"),
|
||||
("material", "material"),
|
||||
("variant", "variant")
|
||||
])
|
||||
def test_setPropertyOtherContainers(target_container, stack_variable, extruder_stack):
|
||||
#Other parameters that don't need to be varied.
|
||||
key = "layer_height"
|
||||
property = "value"
|
||||
value = 0.1337
|
||||
#A mock container in the right spot.
|
||||
container = unittest.mock.MagicMock()
|
||||
container.getMetaDataEntry = unittest.mock.MagicMock(return_value = target_container)
|
||||
setattr(extruder_stack, stack_variable, container) #For instance, set global_stack.qualityChanges = container.
|
||||
|
||||
extruder_stack.setProperty(key, property, value, target_container = target_container) #The actual test.
|
||||
|
||||
getattr(extruder_stack, stack_variable).setProperty.assert_called_once_with(key, property, value) #Make sure that the proper container gets a setProperty call.
|
||||
extruder_stack.userChanges.setProperty.assert_called_once_with(key, property, value) #Make sure that the user container gets a setProperty call.
|
Loading…
Add table
Add a link
Reference in a new issue