mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-18 20:28:01 -06:00
Add tests for setQualityChangesById
One for when the ID exists, one for when it doesn't exist. Contributes to issue CURA-3497.
This commit is contained in:
parent
498956a190
commit
14ac41e58f
1 changed files with 17 additions and 0 deletions
|
@ -511,6 +511,23 @@ def test_setQualityByIdDoesntExist(global_stack):
|
|||
with pytest.raises(KeyError):
|
||||
global_stack.setQualityById("some_quality") #Container registry is empty now.
|
||||
|
||||
## Tests setting quality changes by specifying an ID of a quality change that
|
||||
# exists.
|
||||
def test_setQualityChangesByIdExists(global_stack, container_registry):
|
||||
original_container_registry = UM.Settings.ContainerStack._containerRegistry
|
||||
UM.Settings.ContainerStack._containerRegistry = container_registry #Always has all the profiles you ask of.
|
||||
|
||||
global_stack.setQualityChangesById("some_quality_changes") #The container registry always has a container with the ID.
|
||||
|
||||
#Restore.
|
||||
UM.Settings.ContainerStack._containerRegistry = original_container_registry
|
||||
|
||||
## Tests setting quality changes by specifying an ID of a quality change that
|
||||
# doesn't exist.
|
||||
def test_setQualityChangesByIdDoesntExist(global_stack):
|
||||
with pytest.raises(KeyError):
|
||||
global_stack.setQualityChangesById("some_quality_changes") #Container registry is empty now.
|
||||
|
||||
## Tests setting variants by specifying an ID of a variant that exists.
|
||||
def test_setVariantByIdExists(global_stack, container_registry):
|
||||
original_container_registry = UM.Settings.ContainerStack._containerRegistry
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue