mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07: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.
|
:param file_path: The path of the machine definition to test.
|
||||||
"""
|
"""
|
||||||
definition_id = os.path.basename(file_path).split(".")[0]
|
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)
|
@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:
|
with open(file_path, encoding = "utf-8") as f:
|
||||||
json = f.read()
|
json = f.read()
|
||||||
metadata = DefinitionContainer.deserializeMetadata(json, "test_container_id")
|
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)
|
@pytest.mark.parametrize("file_path", machine_filepaths)
|
||||||
|
|
@ -83,10 +83,10 @@ def assertIsDefinitionValid(definition_container, file_path):
|
||||||
|
|
||||||
# If the definition defines a platform file, it should be in /resources/meshes/
|
# If the definition defines a platform file, it should be in /resources/meshes/
|
||||||
if "platform" in metadata[0]:
|
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]:
|
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)
|
@pytest.mark.parametrize("file_path", definition_filepaths)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue