mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 03:38:59 +08:00
Guard against type checking of DefinitionContainer
Otherwise it finds that we're trying to set a MagicMock into the definition slot. Contributes to issue CURA-3497.
This commit is contained in:
parent
7158ebdaea
commit
16b3c78667
@ -517,7 +517,8 @@ def test_removeContainer(global_stack):
|
||||
|
||||
## Tests setting definitions by specifying an ID of a definition that exists.
|
||||
def test_setDefinitionByIdExists(global_stack, container_registry):
|
||||
global_stack.setDefinitionById("some_definition") #The container registry always has a container with the ID.
|
||||
with unittest.mock.patch("cura.Settings.CuraContainerStack.DefinitionContainer", unittest.mock.MagicMock): #To guard against type checking the DefinitionContainer.
|
||||
global_stack.setDefinitionById("some_definition") #The container registry always has a container with the ID.
|
||||
|
||||
## Tests setting definitions by specifying an ID of a definition that doesn't
|
||||
# exist.
|
||||
|
Loading…
x
Reference in New Issue
Block a user