From c6067ef997aeda671acc7a458e69b6c8b1dbf5bb Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Wed, 13 Sep 2023 10:17:56 +0200 Subject: [PATCH] Fix UT for unknown properties not defined in fdmprinter We allow for that behaviour in general, and even use it ourself for plugins Fixes CURA-11034 --- tests/Settings/TestProfiles.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/tests/Settings/TestProfiles.py b/tests/Settings/TestProfiles.py index 2da455d16d..e479da6f1e 100644 --- a/tests/Settings/TestProfiles.py +++ b/tests/Settings/TestProfiles.py @@ -98,16 +98,6 @@ def test_validateQualityProfiles(file_name): # We don't care what the value is, as long as it's there. assert result["metadata"].get("quality_type", None) is not None - # Check that all the values that we say something about are known. - if "values" in result: - quality_setting_keys = set(result["values"]) - # Prune all the comments from the values - quality_setting_keys = {key for key in quality_setting_keys if not key.startswith("#")} - - has_unknown_settings = not quality_setting_keys.issubset(all_setting_ids) - if has_unknown_settings: - assert False, "The following setting(s) %s are defined in the quality %s, but not in fdmprinter.def.json" % ([key for key in quality_setting_keys if key not in all_setting_ids], file_name) - except Exception as e: # File can't be read, header sections missing, whatever the case, this shouldn't happen! assert False, f"Got an Exception while reading the file [{file_name}]: {e}" @@ -126,11 +116,6 @@ def test_validateIntentProfiles(file_name): assert result["metadata"].get("material", None) is not None, "All intent profiles must be linked to some material." assert result["metadata"].get("variant", None) is not None, "All intent profiles must be linked to some variant." - # Check that all the values that we say something about are known. - if "values" in result: - intent_setting_keys = set(result["values"]) - unknown_settings = intent_setting_keys - all_setting_ids - assert len(unknown_settings) == 0, "The settings {setting_list} are defined in the intent {file_name}, but not in fdmprinter.def.json".format(setting_list = unknown_settings, file_name = file_name) except Exception as e: # File can't be read, header sections missing, whatever the case, this shouldn't happen! assert False, "Got an exception while reading the file {file_name}: {err}".format(file_name = file_name, err = str(e))