From 87ce6246d8941b0ddc2ca52ad7d397180ce00065 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Tue, 28 Mar 2017 18:16:00 +0200 Subject: [PATCH] Introduce a "writable global stack" fixture This one has MockContainers set for all containers that allow calling setProperty --- tests/Settings/TestGlobalStack.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/Settings/TestGlobalStack.py b/tests/Settings/TestGlobalStack.py index e12bbb50fb..3fc965c2af 100644 --- a/tests/Settings/TestGlobalStack.py +++ b/tests/Settings/TestGlobalStack.py @@ -81,6 +81,17 @@ def container_registry(): def global_stack() -> cura.Settings.GlobalStack.GlobalStack: return cura.Settings.GlobalStack.GlobalStack("TestStack") +@pytest.fixture() +def writable_global_stack(global_stack): + global_stack.userChanges = MockContainer("test_user_changes", "user") + global_stack.qualityChanges = MockContainer("test_quality_changes", "quality_changes") + global_stack.quality = MockContainer("test_quality", "quality") + global_stack.material = MockContainer("test_material", "material") + global_stack.variant = MockContainer("test_variant", "variant") + global_stack.definitionChanges = MockContainer("test_definition_changes", "definition_changes") + global_stack.definition = DefinitionContainerSubClass() + return global_stack + ## Place-in function for findContainer that finds only containers that start # with "some_". def findSomeContainers(container_id = "*", container_type = None, type = None, category = "*"):