mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-02 19:43: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
|
@ -80,3 +80,24 @@ def test_deserializeQualityChanges(filename, quality_changes_id, container_regis
|
||||||
stack.deserialize(serialized)
|
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
|
8
tests/Settings/stacks/OnlyQuality.global.cfg
Normal file
8
tests/Settings/stacks/OnlyQuality.global.cfg
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
[general]
|
||||||
|
version = 3
|
||||||
|
name = Only Quality
|
||||||
|
id = OnlyQuality
|
||||||
|
|
||||||
|
[containers]
|
||||||
|
2 = some_instance
|
||||||
|
6 = some_definition
|
Loading…
Add table
Add a link
Reference in a new issue