mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-15 10:47:49 -06:00
Add test for seeing whether definition changes are properly found
Whether the deserialize function finds the definition changes properly. Contributes to issue CURA-3497.
This commit is contained in:
parent
79f6e49280
commit
15de1f235a
2 changed files with 30 additions and 1 deletions
|
@ -143,4 +143,25 @@ def test_deserializeVariant(filename, variant_id, container_registry):
|
|||
|
||||
stack.deserialize(serialized)
|
||||
|
||||
assert stack.variant.getId() == variant_id
|
||||
assert stack.variant.getId() == variant_id
|
||||
|
||||
## Tests whether the definition changes profile is being read properly from a
|
||||
# global stack.
|
||||
@pytest.mark.parametrize("filename, definition_changes_id", [
|
||||
("Global.global.cfg", "empty"),
|
||||
("Global.stack.cfg", "empty"),
|
||||
("MachineLegacy.stack.cfg", "empty"),
|
||||
("OnlyDefinitionChanges.global.cfg", "some_instance"),
|
||||
("Complete.global.cfg", "some_material")
|
||||
])
|
||||
def test_deserializeDefinitionChanges(filename, definition_changes_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.variant.getId() == definition_changes_id
|
Loading…
Add table
Add a link
Reference in a new issue