mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 23:23:57 -06:00
Add test to see whether quality profiles deserialise well
Works just the same as the quality-changes stuff. Contributes to issue CURA-3497.
This commit is contained in:
parent
ba43b835f4
commit
eae6ad0e05
2 changed files with 30 additions and 1 deletions
|
@ -79,4 +79,25 @@ def test_deserializeQualityChanges(filename, quality_changes_id, container_regis
|
|||
|
||||
stack.deserialize(serialized)
|
||||
|
||||
assert stack.qualityChanges.getId() == quality_changes_id
|
||||
assert stack.qualityChanges.getId() == quality_changes_id
|
||||
|
||||
## Tests whether the quality profile is being read properly from a global
|
||||
# stack.
|
||||
@pytest.mark.parametrize("filename, quality_id", [
|
||||
("Global.global.cfg", "empty"),
|
||||
("Global.stack.cfg", "empty"),
|
||||
("MachineLegacy.stack.cfg", "empty"),
|
||||
("OnlyQuality.global.cfg", "some_instance"),
|
||||
("Complete.global.cfg", "some_quality")
|
||||
])
|
||||
def test_deserializeQualityChanges(filename, quality_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.quality.getId() == quality_id
|
Loading…
Add table
Add a link
Reference in a new issue