diff options
author | Jaime van Kessel <nallath@gmail.com> | 2020-10-09 16:08:27 +0300 |
---|---|---|
committer | Jaime van Kessel <nallath@gmail.com> | 2020-10-09 16:08:27 +0300 |
commit | 0493fb24dfd7a49fc1e9db58d9011ec829db87ad (patch) | |
tree | bdd6ba76af7624692cb66b47cd2d3d5dd29b34a2 /tests/Settings | |
parent | 8f4dd3cb120c8c4d5e4c5a8301e1ee79960f48f8 (diff) |
Add extra human readable strings to asserts
Diffstat (limited to 'tests/Settings')
-rw-r--r-- | tests/Settings/TestDefinitionContainer.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/Settings/TestDefinitionContainer.py b/tests/Settings/TestDefinitionContainer.py index d434066d10..ec9e132b24 100644 --- a/tests/Settings/TestDefinitionContainer.py +++ b/tests/Settings/TestDefinitionContainer.py @@ -44,7 +44,7 @@ def test_definitionIds(file_path): :param file_path: The path of the machine definition to test. """ definition_id = os.path.basename(file_path).split(".")[0] - assert " " not in definition_id # Definition IDs are not allowed to have spaces. + assert " " not in definition_id, "Definition located at [%s] contains spaces, this is now allowed!" % file_path # Definition IDs are not allowed to have spaces. @pytest.mark.parametrize("file_path", definition_filepaths) @@ -57,7 +57,7 @@ def test_noCategory(file_path): with open(file_path, encoding = "utf-8") as f: json = f.read() metadata = DefinitionContainer.deserializeMetadata(json, "test_container_id") - assert "category" not in metadata[0] + assert "category" not in metadata[0], "Definition located at [%s] referenced a category, which is no longer allowed" % file_path @pytest.mark.parametrize("file_path", machine_filepaths) @@ -78,15 +78,15 @@ def assertIsDefinitionValid(definition_container, file_path): with open(file_path, encoding = "utf-8") as data: json = data.read() parser, is_valid = definition_container.readAndValidateSerialized(json) - assert is_valid #The definition has invalid JSON structure. + assert is_valid # The definition has invalid JSON structure. metadata = DefinitionContainer.deserializeMetadata(json, "whatever") # If the definition defines a platform file, it should be in /resources/meshes/ if "platform" in metadata[0]: - assert metadata[0]["platform"] in all_meshes + assert metadata[0]["platform"] in all_meshes, "Definition located at [%s] references a platform that could not be found" % file_path if "platform_texture" in metadata[0]: - assert metadata[0]["platform_texture"] in all_images + assert metadata[0]["platform_texture"] in all_images, "Definition located at [%s] references a platform_texture that could not be found" % file_path @pytest.mark.parametrize("file_path", definition_filepaths) |