Skip to content
Permalink
Browse files

Add file comparison for HTML output to processing test generator

Refs #14311
  • Loading branch information
m-kuhn committed Feb 21, 2016
1 parent 20fc30b commit 23802eb5b78745343b2f993240cd501aeff6351f
Showing with 13 additions and 3 deletions.
  1. +13 −3 python/plugins/processing/gui/TestTools.py
@@ -40,7 +40,8 @@
OutputNumber,
OutputString,
OutputRaster,
OutputVector
OutputVector,
OutputHTML
)

from processing.core.parameters import (
@@ -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)
@@ -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

0 comments on commit 23802eb

Please sign in to comment.
You can’t perform that action at this time.