mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -06:00
Add test for deserializing stacks with definitions in them
This tests whether the definition is properly found. Contributes to issue CURA-3497.
This commit is contained in:
parent
91f51d11cd
commit
521e85b2a7
1 changed files with 21 additions and 1 deletions
|
@ -164,4 +164,24 @@ def test_deserializeDefinitionChanges(filename, definition_changes_id, container
|
|||
|
||||
stack.deserialize(serialized)
|
||||
|
||||
assert stack.variant.getId() == definition_changes_id
|
||||
assert stack.variant.getId() == definition_changes_id
|
||||
|
||||
## Tests whether the definition is being read properly from a global stack.
|
||||
@pytest.mark.parametrize("filename, definition_id", [
|
||||
("Global.global.cfg", "some_definition"),
|
||||
("Global.stack.cfg", "some_definition"),
|
||||
("MachineLegacy.stack.cfg", "some_definition"),
|
||||
("OnlyDefinition.global.cfg", "some_definition"),
|
||||
("Complete.global.cfg", "some_definition")
|
||||
])
|
||||
def test_deserializeDefinition(filename, definition_id, container_registry):
|
||||
serialized = readStack(filename)
|
||||
stack = cura.Settings.GlobalStack.GlobalStack("TestStack")
|
||||
|
||||
#Mock the loading of the instance containers.
|
||||
stack.findContainer = findSomeContainers
|
||||
UM.Settings.ContainerStack._containerRegistry = container_registry #Always has all the profiles you ask of.
|
||||
|
||||
stack.deserialize(serialized)
|
||||
|
||||
assert stack.definition.getId() == definition_id
|
Loading…
Add table
Add a link
Reference in a new issue