Add test for missing containers in container stack

This seems to give a different exception than intended at the moment.

Contributes to issue CURA-3497.
This commit is contained in:
Ghostkeeper 2017-03-23 17:31:21 +01:00
parent f579b5f304
commit a95404f72f
No known key found for this signature in database
GPG key ID: C5F96EE2BC0F7E75

View file

@ -215,6 +215,15 @@ def test_deserializeDefinition(filename, definition_id, container_registry, glob
#Restore.
UM.Settings.ContainerStack._containerRegistry = original_container_registry
def test_deserializeMissingContainer(container_registry, global_stack):
serialized = readStack("Global.global.cfg")
try:
global_stack.deserialize(serialized)
except Exception as e:
#Must be exactly Exception, not one of its subclasses, since that is what gets raised when a stack has an unknown container.
#That's why we can't use pytest.raises.
assert type(e) == Exception
## Tests whether the hasUserValue returns true for settings that are changed in
# the user-changes container.
def test_hasUserValueUserChanges(global_stack):