mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-21 21:58:01 -06:00
Fail deserialize test if missing container doesn't raise an exception
If it raised an exception, we were checking whether it was the proper exception. But if it wasn't raising an exception we weren't checking anything. That's fixed now (and the header of the function is improved a bit too). Contributes to issue CURA-3497.
This commit is contained in:
parent
7913ff9bf2
commit
2936b9bf24
1 changed files with 5 additions and 1 deletions
|
@ -283,8 +283,12 @@ def test_deserializeDefinition(filename, definition_id, container_registry, glob
|
|||
#Restore.
|
||||
UM.Settings.ContainerStack._containerRegistry = original_container_registry
|
||||
|
||||
def test_deserializeMissingContainer(container_registry, global_stack):
|
||||
## Tests that when a global stack is loaded with an unknown instance, it raises
|
||||
# an exception.
|
||||
def test_deserializeMissingContainer(global_stack):
|
||||
serialized = readStack("Global.global.cfg")
|
||||
with pytest.raises(Exception):
|
||||
global_stack.deserialize(serialized)
|
||||
try:
|
||||
global_stack.deserialize(serialized)
|
||||
except Exception as e:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue