Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGhostkeeper <rubend@tutanota.com>2019-09-27 16:13:23 +0300
committerGhostkeeper <rubend@tutanota.com>2019-09-27 16:13:23 +0300
commit97eaeab3bdeb057ecd3c817a0bc2afb1cc2e03b0 (patch)
tree63d4ac3a8d993c98efefce5c6b8ab83bb0c0e483 /tests/TestIntentManager.py
parent7a1850a87bb96b26e799cc9b90cfec70486cd459 (diff)
Fix missing intent in mock and missing quality_type
These are used by the code. Otherwise there would be an AttributeError of 'intent' not existing, and the quality type in the quality node wouldn't match because it's a magic mock.
Diffstat (limited to 'tests/TestIntentManager.py')
-rw-r--r--tests/TestIntentManager.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/TestIntentManager.py b/tests/TestIntentManager.py
index a82de1273d..aeb21263a8 100644
--- a/tests/TestIntentManager.py
+++ b/tests/TestIntentManager.py
@@ -19,7 +19,7 @@ mocked_intent_metadata = [
mocked_qualitygroup_metadata = {
"normal": QualityGroup("um3_aa4_pla_normal", "normal"),
- "abnorm": QualityGroup("um3_aa4_pla_abnorm", "abnorm")} # type:Dict[str, QualityGroup]
+ "abnorm": QualityGroup("um3_aa4_pla_abnorm", "abnorm")} # type: Dict[str, QualityGroup]
@pytest.fixture
def mock_container_tree() -> MagicMock:
@@ -33,6 +33,7 @@ def mock_container_tree() -> MagicMock:
"generic_pla": MagicMock(
qualities = {
"um3_aa4_pla_normal": MagicMock(
+ quality_type = "normal",
intents = {
"smooth": MagicMock(
intent_category = "smooth",
@@ -41,6 +42,7 @@ def mock_container_tree() -> MagicMock:
}
),
"um3_aa4_pla_abnorm": MagicMock(
+ quality_type = "abnorm",
intents = {
"strong": MagicMock(
intent_category = "strong",
@@ -104,10 +106,12 @@ def doSetup(application, extruder_manager, container_registry, global_stack) ->
extruder_stack_a.variant = MockContainer({"name": "AA 0.4"})
extruder_stack_a.quality = MockContainer({"id": "um3_aa4_pla_normal"})
extruder_stack_a.material = MockContainer({"base_file": "generic_pla"})
+ extruder_stack_a.intent = MockContainer({"id": "empty_intent", "intent_category": "default"})
extruder_stack_b = MockContainer({"id": "Extruder II: Plastic Boogaloo"})
extruder_stack_b.variant = MockContainer({"name": "AA 0.4"})
extruder_stack_b.quality = MockContainer({"id": "um3_aa4_pla_normal"})
extruder_stack_b.material = MockContainer({"base_file": "generic_pla"})
+ extruder_stack_b.intent = MockContainer({"id": "empty_intent", "intent_category": "default"})
global_stack.extruderList = [extruder_stack_a, extruder_stack_b]
application.getGlobalContainerStack = MagicMock(return_value = global_stack)