Skip to content

Commit 23802eb

Browse files
committed
Add file comparison for HTML output to processing test generator
Refs #14311
1 parent 20fc30b commit 23802eb

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

python/plugins/processing/gui/TestTools.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
OutputNumber,
4141
OutputString,
4242
OutputRaster,
43-
OutputVector
43+
OutputVector,
44+
OutputHTML
4445
)
4546

4647
from processing.core.parameters import (
@@ -156,8 +157,8 @@ def createTest(text):
156157

157158
definition['params'] = params
158159

159-
for i, out in enumerate(alg.outputs):
160-
token = tokens[i - len(alg.outputs)]
160+
for i, out in enumerate([out for out in alg.outputs if not out.hidden]):
161+
token = tokens[i - alg.getVisibleOutputsCount()]
161162

162163
if isinstance(out, (OutputNumber, OutputString)):
163164
results[out.name] = unicode(out)
@@ -179,6 +180,15 @@ def createTest(text):
179180
}
180181
if not schema:
181182
results[out.name]['location'] = '[The expected result data is not in the testdata directory. Please write it to processing/tests/testdata/expected. Prefer gml files.]'
183+
elif isinstance(out, OutputHTML):
184+
filename = token[1:-1]
185+
schema, filepath = extractSchemaPath(filename)
186+
results[out.name] = {
187+
'type': 'file',
188+
'name': filepath
189+
}
190+
if not schema:
191+
results[out.name]['location'] = '[The expected result file is not in the testdata directory. Please redirect the output to processing/tests/testdata/expected.]'
182192

183193
definition['results'] = results
184194

0 commit comments

Comments
 (0)