mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 09:59:00 +08:00
Fixes unit fallthrough unit test
CURA-3738
This commit is contained in:
parent
434aaed767
commit
da63932a95
@ -250,7 +250,8 @@ def test_getPropertyFallThrough(extruder_stack):
|
|||||||
container_indices = cura.Settings.CuraContainerStack._ContainerIndexes #Cache.
|
container_indices = cura.Settings.CuraContainerStack._ContainerIndexes #Cache.
|
||||||
for type_id, type_name in container_indices.IndexTypeMap.items():
|
for type_id, type_name in container_indices.IndexTypeMap.items():
|
||||||
container = unittest.mock.MagicMock()
|
container = unittest.mock.MagicMock()
|
||||||
container.getProperty = lambda key, property, type_id = type_id: type_id if (key == "layer_height" and property == "value") else None #Returns the container type ID as layer height, in order to identify it.
|
# Return type_id when asking for value and -1 when asking for limit_to_extruder
|
||||||
|
container.getProperty = lambda key, property, type_id = type_id: type_id if (key == "layer_height" and property == "value") else (None if property != "limit_to_extruder" else "-1") #Returns the container type ID as layer height, in order to identify it.
|
||||||
container.hasProperty = lambda key, property: key == "layer_height"
|
container.hasProperty = lambda key, property: key == "layer_height"
|
||||||
container.getMetaDataEntry = unittest.mock.MagicMock(return_value = type_name)
|
container.getMetaDataEntry = unittest.mock.MagicMock(return_value = type_name)
|
||||||
mock_layer_heights[type_id] = container
|
mock_layer_heights[type_id] = container
|
||||||
|
Loading…
x
Reference in New Issue
Block a user