Skip to content

Commit

Permalink
[processing] add support for custom parameter used in interpolation algs
Browse files Browse the repository at this point in the history
to the test suite
  • Loading branch information
alexbruy committed Dec 20, 2016
1 parent 37d82bb commit ea4f05d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
8 changes: 8 additions & 0 deletions python/plugins/processing/tests/AlgorithmsTestBase.py
Expand Up @@ -142,6 +142,14 @@ def load_param(self, param):
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
Expand Down
17 changes: 12 additions & 5 deletions python/plugins/processing/tests/testdata/qgis_algorithm_tests.yaml
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -1292,7 +1300,6 @@ tests:
# name: expected/triangulation.gml
# type: vector


- algorithm: qgis:removenullgeometries
name: Remove null geometries
params:
Expand Down

0 comments on commit ea4f05d

Please sign in to comment.