mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 20:19:13 +08:00
Add test for hasUserValue returning false
When a value is not in user changes or in quality changes, it is no longer a user value so it shouldn't get marked as one. Contributes to issue CURA-3497.
This commit is contained in:
parent
bbddc2308e
commit
2c9e115488
@ -473,6 +473,16 @@ def test_hasUserValueQualityChanges(global_stack):
|
||||
assert not global_stack.hasUserValue("infill_sparse_density")
|
||||
assert not global_stack.hasUserValue("")
|
||||
|
||||
## Tests whether a container in some other place on the stack is correctly not
|
||||
# recognised as user value.
|
||||
def test_hasNoUserValue(global_stack):
|
||||
container = unittest.mock.MagicMock()
|
||||
container.getMetaDataEntry = unittest.mock.MagicMock(return_value = "quality")
|
||||
container.hasProperty = lambda key, property: key == "layer_height" #Only have the layer_height property set.
|
||||
global_stack.quality = container
|
||||
|
||||
assert not global_stack.hasUserValue("layer_height") #However this container is quality, so it's not a user value.
|
||||
|
||||
## Tests whether inserting a container is properly forbidden.
|
||||
def test_insertContainer(global_stack):
|
||||
with pytest.raises(InvalidOperationError):
|
||||
|
Loading…
x
Reference in New Issue
Block a user