Skip to content

Commit

Permalink
Add file comparison for HTML output to processing test generator
Browse files Browse the repository at this point in the history
Refs #14311
  • Loading branch information
m-kuhn committed Feb 21, 2016
1 parent 20fc30b commit 23802eb
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions python/plugins/processing/gui/TestTools.py
Expand Up @@ -40,7 +40,8 @@
OutputNumber,
OutputString,
OutputRaster,
OutputVector
OutputVector,
OutputHTML
)

from processing.core.parameters import (
Expand Down Expand Up @@ -156,8 +157,8 @@ def createTest(text):

definition['params'] = params

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

if isinstance(out, (OutputNumber, OutputString)):
results[out.name] = unicode(out)
Expand All @@ -179,6 +180,15 @@ def createTest(text):
}
if not schema:
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.]'
elif isinstance(out, OutputHTML):
filename = token[1:-1]
schema, filepath = extractSchemaPath(filename)
results[out.name] = {
'type': 'file',
'name': filepath
}
if not schema:
results[out.name]['location'] = '[The expected result file is not in the testdata directory. Please redirect the output to processing/tests/testdata/expected.]'

definition['results'] = results

Expand Down

0 comments on commit 23802eb

Please sign in to comment.