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
This commit is contained in:
Jelle Spijker 2023-09-13 10:17:56 +02:00
parent 3555073ee4
commit c6067ef997
No known key found for this signature in database
GPG Key ID: 034D1C0527888B65

View File

@ -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))