mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 21:13:58 -06:00
Add extra human readable strings to asserts
This commit is contained in:
parent
8f4dd3cb12
commit
0493fb24df
1 changed files with 5 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue