mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 06:55:54 +08:00
Add test for moving definition containers
When a definition container is in the wrong spot in a stack file it needs to be moved to the definition slot. Contributes to issue CURA-3497.
This commit is contained in:
parent
e807739117
commit
f12ffad2c1
@ -345,6 +345,17 @@ def test_deserializeMoveInstanceContainer(global_stack):
|
|||||||
assert global_stack.quality.getId() == "empty"
|
assert global_stack.quality.getId() == "empty"
|
||||||
assert global_stack.material.getId() != "empty"
|
assert global_stack.material.getId() != "empty"
|
||||||
|
|
||||||
|
## Tests whether a definition container in the wrong spot is moved into the
|
||||||
|
# correct spot by deserialising.
|
||||||
|
def test_deserializeMoveDefinitionContainer(global_stack):
|
||||||
|
global_stack._containers[cura.Settings.CuraContainerStack._ContainerIndexes.Material] = DefinitionContainer(container_id = "some definition") #Not in the correct spot.
|
||||||
|
|
||||||
|
with unittest.mock.patch("UM.Settings.ContainerStack.ContainerStack.deserialize", unittest.mock.MagicMock()): #Prevent calling super().deserialize.
|
||||||
|
global_stack.deserialize("")
|
||||||
|
|
||||||
|
assert global_stack.material.getId() == "empty"
|
||||||
|
assert global_stack.definition.getId() != "empty"
|
||||||
|
|
||||||
## Tests whether the user changes are being read properly from a global stack.
|
## Tests whether the user changes are being read properly from a global stack.
|
||||||
@pytest.mark.skip
|
@pytest.mark.skip
|
||||||
@pytest.mark.parametrize("filename, user_changes_id", [
|
@pytest.mark.parametrize("filename, user_changes_id", [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user