Skip to content

Commit 698caf3

Browse files
committed
[core] test: Add explicit messages when a template fails its validation
1 parent 4585522 commit 698caf3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

meshroom/core/test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,19 @@ def checkTemplateVersions(path: str, nodesAlreadyLoaded: bool = False) -> bool:
1919
try:
2020
graphData = fileData.get(GraphIO.Keys.Graph, fileData)
2121
if not isinstance(graphData, dict):
22+
print(f"File '{path}' does not contain a valid graph.")
2223
return False
2324

2425
header = fileData.get(GraphIO.Keys.Header, {})
2526
if not header.get("template", False):
27+
print(f"File '{path}' is not a valid template.")
2628
return False
2729
nodesVersions = header.get(GraphIO.Keys.NodesVersions, {})
2830

2931
for _, nodeData in graphData.items():
3032
nodeType = nodeData["nodeType"]
3133
if not meshroom.core.pluginManager.isRegistered(nodeType):
34+
print(f"'{nodeType}' in '{path}' is an unknown type.")
3235
return False
3336

3437
nodeDesc = meshroom.core.pluginManager.getRegisteredNodePlugin(nodeType).nodeDescriptor
@@ -53,7 +56,7 @@ def checkTemplateVersions(path: str, nodesAlreadyLoaded: bool = False) -> bool:
5356
break
5457

5558
if compatibilityIssue is not None:
56-
print(f"{compatibilityIssue} in {path} for node {nodeType}")
59+
print(f"{compatibilityIssue} in '{path}' for node '{nodeType}'.")
5760
return False
5861

5962
return True

0 commit comments

Comments
 (0)