[processing] add support for custom parameter used in interpolation algs

to the test suite
This commit is contained in:
Alexander Bruy 2016-12-20 14:29:51 +02:00
parent 37d82bb7a5
commit ea4f05d931
2 changed files with 20 additions and 5 deletions

View File

@ -142,6 +142,14 @@ class AlgorithmsTest(object):
return [self.load_param(p) for p in param['params']]
elif param['type'] == 'file':
return self.filepath_from_param(param)
elif param['type'] == 'interpolation':
prefix = processingTestDataPath()
tmp = ''
for r in param['name'].split(';'):
v = r.split(',')
tmp += '{},{},{},{};'.format(os.path.join(prefix, v[0]),
v[1], v[2], v[3])
return tmp[:-1]
except TypeError:
# No type specified, use whatever is there
return param

View File

@ -1234,7 +1234,9 @@ tests:
COLUMNS: 300
DISTANCE_COEFFICIENT: 2.0
EXTENT: 0, 8, -5, 3
INTERPOLATION_DATA: /home/alex/devel/qgis/python/plugins/processing/tests/testdata/pointsz.gml,False,1,0
INTERPOLATION_DATA:
name: pointsz.gml,False,1,0
type: interpolation
ROWS: 300
results:
OUTPUT_LAYER:
@ -1249,7 +1251,9 @@ tests:
COLUMNS: 300
DISTANCE_COEFFICIENT: 2.0
EXTENT: 0, 8, -5, 3
INTERPOLATION_DATA: /home/alex/devel/qgis/python/plugins/processing/tests/testdata/pointsz.gml,True,-1,0
INTERPOLATION_DATA:
name: pointsz.gml,True,-1,0
type: interpolation
ROWS: 300
results:
OUTPUT_LAYER:
@ -1263,7 +1267,9 @@ tests:
CELLSIZE_Y: 0.02667
COLUMNS: 300
EXTENT: 0, 8, -5, 3
INTERPOLATION_DATA: /home/alex/devel/qgis/python/plugins/processing/tests/testdata/pointsz.gml,False,1,0
INTERPOLATION_DATA:
name: pointsz.gml,False,1,0
type: interpolation
METHOD: '0'
ROWS: 300
results:
@ -1281,7 +1287,9 @@ tests:
CELLSIZE_Y: 0.02667
COLUMNS: 300
EXTENT: 0, 8, -5, 3
INTERPOLATION_DATA: /home/alex/devel/qgis/python/plugins/processing/tests/testdata/pointsz.gml,True,-1,0
INTERPOLATION_DATA:
name: pointsz.gml,True,-1,0
type: interpolation
METHOD: '1'
ROWS: 300
results:
@ -1292,7 +1300,6 @@ tests:
# name: expected/triangulation.gml
# type: vector
- algorithm: qgis:removenullgeometries
name: Remove null geometries
params: