mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 19:45:57 +08:00
Don't modify ContainerStack._containerRegistry property
We do not use it in GlobalStack
This commit is contained in:
parent
385d8ac5b5
commit
270cdd08cb
@ -441,14 +441,8 @@ def test_removeContainer(global_stack):
|
|||||||
|
|
||||||
## Tests setting definitions by specifying an ID of a definition that exists.
|
## Tests setting definitions by specifying an ID of a definition that exists.
|
||||||
def test_setDefinitionByIdExists(global_stack, container_registry):
|
def test_setDefinitionByIdExists(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.setDefinitionById("some_definition") #The container registry always has a container with the ID.
|
global_stack.setDefinitionById("some_definition") #The container registry always has a container with the ID.
|
||||||
|
|
||||||
#Restore.
|
|
||||||
UM.Settings.ContainerStack._containerRegistry = original_container_registry
|
|
||||||
|
|
||||||
## Tests setting definitions by specifying an ID of a definition that doesn't
|
## Tests setting definitions by specifying an ID of a definition that doesn't
|
||||||
# exist.
|
# exist.
|
||||||
def test_setDefinitionByIdDoesntExist(global_stack):
|
def test_setDefinitionByIdDoesntExist(global_stack):
|
||||||
@ -458,14 +452,8 @@ def test_setDefinitionByIdDoesntExist(global_stack):
|
|||||||
## Tests setting definition changes by specifying an ID of a container that
|
## Tests setting definition changes by specifying an ID of a container that
|
||||||
# exists.
|
# exists.
|
||||||
def test_setDefinitionChangesByIdExists(global_stack, container_registry):
|
def test_setDefinitionChangesByIdExists(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.setDefinitionChangesById("some_definition_changes") #The container registry always has a container with the ID.
|
global_stack.setDefinitionChangesById("some_definition_changes") #The container registry always has a container with the ID.
|
||||||
|
|
||||||
#Restore.
|
|
||||||
UM.Settings.ContainerStack._containerRegistry = original_container_registry
|
|
||||||
|
|
||||||
## Tests setting definition changes by specifying an ID of a container that
|
## Tests setting definition changes by specifying an ID of a container that
|
||||||
# doesn't exist.
|
# doesn't exist.
|
||||||
def test_setDefinitionChangesByIdDoesntExist(global_stack):
|
def test_setDefinitionChangesByIdDoesntExist(global_stack):
|
||||||
@ -474,14 +462,8 @@ def test_setDefinitionChangesByIdDoesntExist(global_stack):
|
|||||||
|
|
||||||
## Tests setting materials by specifying an ID of a material that exists.
|
## Tests setting materials by specifying an ID of a material that exists.
|
||||||
def test_setMaterialByIdExists(global_stack, container_registry):
|
def test_setMaterialByIdExists(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.setMaterialById("some_material") #The container registry always has a container with the ID.
|
global_stack.setMaterialById("some_material") #The container registry always has a container with the ID.
|
||||||
|
|
||||||
#Restore.
|
|
||||||
UM.Settings.ContainerStack._containerRegistry = original_container_registry
|
|
||||||
|
|
||||||
## Tests setting materials by specifying an ID of a material that doesn't
|
## Tests setting materials by specifying an ID of a material that doesn't
|
||||||
# exist.
|
# exist.
|
||||||
def test_setMaterialByIdDoesntExist(global_stack):
|
def test_setMaterialByIdDoesntExist(global_stack):
|
||||||
@ -536,14 +518,8 @@ def test_setPropertyOtherContainers(target_container, global_stack):
|
|||||||
|
|
||||||
## Tests setting qualities by specifying an ID of a quality that exists.
|
## Tests setting qualities by specifying an ID of a quality that exists.
|
||||||
def test_setQualityByIdExists(global_stack, container_registry):
|
def test_setQualityByIdExists(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.setQualityById("some_quality") #The container registry always has a container with the ID.
|
global_stack.setQualityById("some_quality") #The container registry always has a container with the ID.
|
||||||
|
|
||||||
#Restore.
|
|
||||||
UM.Settings.ContainerStack._containerRegistry = original_container_registry
|
|
||||||
|
|
||||||
## Tests setting qualities by specifying an ID of a quality that doesn't exist.
|
## Tests setting qualities by specifying an ID of a quality that doesn't exist.
|
||||||
def test_setQualityByIdDoesntExist(global_stack):
|
def test_setQualityByIdDoesntExist(global_stack):
|
||||||
with pytest.raises(KeyError):
|
with pytest.raises(KeyError):
|
||||||
@ -552,14 +528,8 @@ def test_setQualityByIdDoesntExist(global_stack):
|
|||||||
## Tests setting quality changes by specifying an ID of a quality change that
|
## Tests setting quality changes by specifying an ID of a quality change that
|
||||||
# exists.
|
# exists.
|
||||||
def test_setQualityChangesByIdExists(global_stack, container_registry):
|
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.
|
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
|
## Tests setting quality changes by specifying an ID of a quality change that
|
||||||
# doesn't exist.
|
# doesn't exist.
|
||||||
def test_setQualityChangesByIdDoesntExist(global_stack):
|
def test_setQualityChangesByIdDoesntExist(global_stack):
|
||||||
@ -568,14 +538,8 @@ def test_setQualityChangesByIdDoesntExist(global_stack):
|
|||||||
|
|
||||||
## Tests setting variants by specifying an ID of a variant that exists.
|
## Tests setting variants by specifying an ID of a variant that exists.
|
||||||
def test_setVariantByIdExists(global_stack, container_registry):
|
def test_setVariantByIdExists(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.setVariantById("some_variant") #The container registry always has a container with the ID.
|
global_stack.setVariantById("some_variant") #The container registry always has a container with the ID.
|
||||||
|
|
||||||
#Restore.
|
|
||||||
UM.Settings.ContainerStack._containerRegistry = original_container_registry
|
|
||||||
|
|
||||||
## Tests setting variants by specifying an ID of a variant that doesn't exist.
|
## Tests setting variants by specifying an ID of a variant that doesn't exist.
|
||||||
def test_setVariantByIdDoesntExist(global_stack):
|
def test_setVariantByIdDoesntExist(global_stack):
|
||||||
with pytest.raises(KeyError):
|
with pytest.raises(KeyError):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user