Start to test other IntentManager functions.

Very rudimentary at the moment, need to split the method into 3, and make a class for the setup.
This also uncovered that the currentAvailableIntents doesn't (unless the global stack is missing) retrun any default intents, while currentAvailableIntentCategories does do that.
Since it's not clear how we're going to handle that right now, I made a TODO in the code, which of course will have to be fixed before this/these branch/es are merged.

part of CURA-6091
This commit is contained in:
Remco Burema 2019-06-28 12:10:39 +02:00
parent 6b918dbd1d
commit 810fee37eb
2 changed files with 19 additions and 10 deletions

View file

@ -71,9 +71,11 @@ class IntentManager(QObject):
global_stack = application.getGlobalContainerStack()
if global_stack is None:
return [("default", "normal")]
# TODO: We now do this (return a default) if the global stack is missing, but not in the code below,
# even though there should always be defaults. The problem then is what to do with the quality_types.
# Currently _also_ inconsistent with 'currentAvailableIntentCategoreis', which _does_ return default.
quality_groups = application.getQualityManager().getQualityGroups(global_stack)
available_quality_types = {quality_group.quality_type for quality_group in quality_groups.values() if quality_group.node_for_global is not None}
# available_quality_types could just be 'quality_group.keys()', except for that the node_for_global may be None
final_intent_ids = set() #type: Set[str]
current_definition_id = global_stack.definition.getMetaDataEntry("id")