mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 05:49:01 +08: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
@ -164,4 +164,24 @@ def test_deserializeDefinitionChanges(filename, definition_changes_id, container
|
|||||||
|
|
||||||
stack.deserialize(serialized)
|
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…
x
Reference in New Issue
Block a user