diff --git a/tests/Settings/TestDefinitionContainer.py b/tests/Settings/TestDefinitionContainer.py index 73d10d871c..6e502280cd 100644 --- a/tests/Settings/TestDefinitionContainer.py +++ b/tests/Settings/TestDefinitionContainer.py @@ -58,7 +58,7 @@ def assertIsDefinitionValid(definition_container, path, file_name): # definition that defines a "value", the "default_value" is ineffective. This # test fails on those things. @pytest.mark.parametrize("file_name", machine_filepaths) -def test_validateOverridingDefaultValue(file_name): +def test_validateOverridingDefaultValue(file_name: str): definition_path = os.path.join(os.path.dirname(__file__), "..", "..", "resources", "definitions", file_name) with open(definition_path, encoding = "utf-8") as f: doc = json.load(f) @@ -124,4 +124,16 @@ def merge_dicts(base: Dict[str, Any], overrides: Dict[str, Any]) -> Dict[str, An result[key] = merge_dicts(result[key], val) else: result[key] = val - return result \ No newline at end of file + return result + +## Verifies that definition contains don't have an ID field. +# +# ID fields are legacy. They should not be used any more. This is legacy that +# people don't seem to be able to get used to. +@pytest.mark.parametrize("file_name", machine_filepaths) +def test_noId(file_name): + definition_path = os.path.join(os.path.dirname(__file__), "..", "..", "resources", "definitions", file_name) + with open(definition_path, encoding = "utf-8") as f: + doc = json.load(f) + + assert "id" not in doc, "Definitions should not have an ID field." \ No newline at end of file