mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 09:47:50 -06:00
Add check for platform mesh & texture
It simply checks if the file exists
This commit is contained in:
parent
c3b447cd89
commit
338f9c0052
8 changed files with 11 additions and 7 deletions
|
@ -18,7 +18,8 @@ Resources.addSearchPath(os.path.abspath(os.path.join(os.path.dirname(__file__),
|
|||
|
||||
|
||||
machine_filepaths = os.listdir(os.path.join(os.path.dirname(__file__), "..", "..", "resources", "definitions"))
|
||||
|
||||
all_meshes = os.listdir(os.path.join(os.path.dirname(__file__), "..", "..", "resources", "meshes"))
|
||||
all_images = os.listdir(os.path.join(os.path.dirname(__file__), "..", "..", "resources", "images"))
|
||||
|
||||
@pytest.fixture
|
||||
def definition_container():
|
||||
|
@ -44,5 +45,13 @@ def isDefinitionValid(definition_container, path, file_name):
|
|||
parser, is_valid = definition_container.readAndValidateSerialized(json)
|
||||
if not is_valid:
|
||||
print("The definition '{0}', has invalid data.".format(file_name))
|
||||
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
|
||||
|
||||
if "platform_texture" in metadata[0]:
|
||||
assert metadata[0]["platform_texture"] in all_images
|
||||
|
||||
return is_valid
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue