mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 08:38:58 +08:00
Use a proper container mock for test user/quality changes
This commit is contained in:
parent
30fd1ded45
commit
d7984c888b
@ -465,7 +465,8 @@ def test_getPropertyWithResolve(global_stack):
|
|||||||
## Tests whether the hasUserValue returns true for settings that are changed in
|
## Tests whether the hasUserValue returns true for settings that are changed in
|
||||||
# the user-changes container.
|
# the user-changes container.
|
||||||
def test_hasUserValueUserChanges(global_stack):
|
def test_hasUserValueUserChanges(global_stack):
|
||||||
user_changes = unittest.mock.MagicMock()
|
user_changes = MockContainer("test_user_changes", "user")
|
||||||
|
|
||||||
def hasProperty(key, property):
|
def hasProperty(key, property):
|
||||||
return key == "layer_height" and property == "value" # Only have the layer_height property set.
|
return key == "layer_height" and property == "value" # Only have the layer_height property set.
|
||||||
user_changes.hasProperty = hasProperty
|
user_changes.hasProperty = hasProperty
|
||||||
@ -479,7 +480,8 @@ def test_hasUserValueUserChanges(global_stack):
|
|||||||
## Tests whether the hasUserValue returns true for settings that are changed in
|
## Tests whether the hasUserValue returns true for settings that are changed in
|
||||||
# the quality-changes container.
|
# the quality-changes container.
|
||||||
def test_hasUserValueQualityChanges(global_stack):
|
def test_hasUserValueQualityChanges(global_stack):
|
||||||
quality_changes = unittest.mock.MagicMock()
|
quality_changes = MockContainer("test_quality_changes", "quality_changes")
|
||||||
|
|
||||||
def hasProperty(key, property):
|
def hasProperty(key, property):
|
||||||
return key == "layer_height" and property == "value" # Only have the layer_height property set.
|
return key == "layer_height" and property == "value" # Only have the layer_height property set.
|
||||||
quality_changes.hasProperty = hasProperty
|
quality_changes.hasProperty = hasProperty
|
||||||
|
Loading…
x
Reference in New Issue
Block a user