Skip to content

Commit dbd1050

Browse files
author
Médéric RIBREUX
committed
[Processing][Tests] Improve Processing GRASS7 testsuite
1 parent 3b998d2 commit dbd1050

File tree

6 files changed

+882
-5
lines changed

6 files changed

+882
-5
lines changed

python/plugins/processing/tests/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ IF(ENABLE_TESTS)
99
ADD_PYTHON_TEST(ProcessingParametersTest ParametersTest.py)
1010
ADD_PYTHON_TEST(ProcessingQgisAlgorithmsTest QgisAlgorithmsTest.py)
1111
ADD_PYTHON_TEST(ProcessingGdalAlgorithmsTest GdalAlgorithmsTest.py)
12-
ADD_PYTHON_TEST(ProcessingGrass7AlgorithmsTest Grass7AlgorithmsTest.py)
12+
ADD_PYTHON_TEST(ProcessingGrass7AlgorithmsImageryTest Grass7AlgorithmsImageryTest.py)
13+
ADD_PYTHON_TEST(ProcessingGrass7AlgorithmsRasterTest Grass7AlgorithmsRasterTest.py)
1314
ENDIF(ENABLE_TESTS)
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# -*- coding: utf-8 -*-
2+
3+
"""
4+
***************************************************************************
5+
Grass7AlgorithmsImageryTest.py
6+
------------------------------
7+
Date : May 2016
8+
Copyright : (C) 2016 by Médéric Ribreux
9+
Email : mederic dot ribreux at medspx dot fr
10+
***************************************************************************
11+
* *
12+
* This program is free software; you can redistribute it and/or modify *
13+
* it under the terms of the GNU General Public License as published by *
14+
* the Free Software Foundation; either version 2 of the License, or *
15+
* (at your option) any later version. *
16+
* *
17+
***************************************************************************
18+
"""
19+
20+
__author__ = 'Médéric Ribreux'
21+
__date__ = 'May 2016'
22+
__copyright__ = '(C) 2016, Médéric Ribreux'
23+
24+
# This will get replaced with a git SHA1 when you do a git archive
25+
26+
__revision__ = ':%H$'
27+
28+
import AlgorithmsTestBase
29+
30+
import nose2
31+
import shutil
32+
33+
from qgis.testing import (
34+
start_app,
35+
unittest
36+
)
37+
38+
39+
class TestGrass7AlgorithmsImageryTest(unittest.TestCase, AlgorithmsTestBase.AlgorithmsTest):
40+
41+
@classmethod
42+
def setUpClass(cls):
43+
start_app()
44+
from processing.core.Processing import Processing
45+
Processing.initialize()
46+
cls.cleanup_paths = []
47+
48+
@classmethod
49+
def tearDownClass(cls):
50+
for path in cls.cleanup_paths:
51+
shutil.rmtree(path)
52+
53+
def test_definition_file(self):
54+
return 'grass7_algorithms_imagery_tests.yaml'
55+
56+
57+
if __name__ == '__main__':
58+
nose2.main()

python/plugins/processing/tests/Grass7AlgorithmsTest.py renamed to python/plugins/processing/tests/Grass7AlgorithmsRasterTest.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
"""
44
***************************************************************************
5-
Grass7AlgorithmTests.py
6-
-----------------------
5+
Grass7AlgorithmsRasterTest.py
6+
-----------------------------
77
Date : May 2016
88
Copyright : (C) 2016 by Médéric Ribreux
99
Email : mederic dot ribreux at medspx dot fr
@@ -36,7 +36,7 @@
3636
)
3737

3838

39-
class TestGrass7Algorithms(unittest.TestCase, AlgorithmsTestBase.AlgorithmsTest):
39+
class TestGrass7AlgorithmsRasterTest(unittest.TestCase, AlgorithmsTestBase.AlgorithmsTest):
4040

4141
@classmethod
4242
def setUpClass(cls):
@@ -51,7 +51,7 @@ def tearDownClass(cls):
5151
shutil.rmtree(path)
5252

5353
def test_definition_file(self):
54-
return 'grass7_algorithm_tests.yaml'
54+
return 'grass7_algorithms_raster_tests.yaml'
5555

5656

5757
if __name__ == '__main__':
Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
# Here is a list of grass7 algorithms without test units
2+
3+
## Raster algorithms
4+
5+
* r.basins.fill
6+
* r.blend.combine
7+
* r.blend.rgb
8+
* r.buffer
9+
* r.buffer.lowmem
10+
* r.carve
11+
* r.category
12+
* r.category.out
13+
* r.circle
14+
* r.clump
15+
* r.coin
16+
* r.colors
17+
* r.colors.out
18+
* r.colors.stddev
19+
* r.composite
20+
* r.contour.level
21+
* r.contour.step
22+
* r.cost.coordinates
23+
* r.cost.points
24+
* r.cost.raster
25+
* r.covar
26+
* r.cross
27+
* r.describe
28+
* r.distance
29+
* r.drain
30+
* r.fill.dir
31+
* r.fillnulls
32+
* r.flow
33+
* r.flow.aspect
34+
* r.flow.aspect.barrier
35+
* r.flow.barrier
36+
* r.grow
37+
* r.grow.distance
38+
* r.gwflow
39+
* r.his
40+
* r.horizon
41+
* r.horizon.height
42+
* r.in.lidar
43+
* r.in.lidar.info
44+
* r.info
45+
* r.kappa
46+
* r.lake.coords
47+
* r.lake.layer
48+
* r.latlong
49+
* r.li.cwed
50+
* r.li.cwed.ascii
51+
* r.li.dominance
52+
* r.li.dominance.ascii
53+
* r.li.edgedensity
54+
* r.li.edgedensity.ascii
55+
* r.li.mpa
56+
* r.li.mpa.ascii
57+
* r.li.mps
58+
* r.li.mps.ascii
59+
* r.li.padcv
60+
* r.li.padcv.ascii
61+
* r.li.padrange
62+
* r.li.padrange.ascii
63+
* r.li.padsd
64+
* r.li.padsd.ascii
65+
* r.li.patchdensity
66+
* r.li.patchdensity.ascii
67+
* r.li.patchnum
68+
* r.li.patchnum.ascii
69+
* r.li.pielou
70+
* r.li.pielou.ascii
71+
* r.li.renyi
72+
* r.li.renyi.ascii
73+
* r.li.richness
74+
* r.li.richness.ascii
75+
* r.li.shannon
76+
* r.li.shannon.ascii
77+
* r.li.shape
78+
* r.li.shape.ascii
79+
* r.li.simpson
80+
* r.li.simpson.ascii
81+
* r.mapcalc
82+
* r.mask.rast
83+
* r.mask.vect
84+
* r.median
85+
* r.mfilter
86+
* r.mfilter.fp
87+
* r.mode
88+
* r.neighbors
89+
* r.null
90+
* r.out.gridatb
91+
* r.out.ppm
92+
* r.out.vrml
93+
* r.param.scale
94+
* r.patch
95+
* r.plane
96+
* r.profile
97+
* r.quant
98+
* r.quantile
99+
* r.random
100+
* r.random.cells
101+
* r.random.raster
102+
* r.random.surface
103+
* r.reclass
104+
* r.reclass.area.greater
105+
* r.reclass.area.lesser
106+
* r.recode
107+
* r.regression.line
108+
* r.regression.multi
109+
* r.relief
110+
* r.relief.scaling
111+
* r.report
112+
* r.resamp.bspline
113+
* r.resamp.filter
114+
* r.resamp.interp
115+
* r.resamp.rst
116+
* r.resamp.stats
117+
* r.resample
118+
* r.rescale
119+
* r.rescale.eq
120+
* r.rgb
121+
* r.ros
122+
* r.series
123+
* r.series.accumulate
124+
* r.series.interp
125+
* r.shade
126+
* r.sim.sediment
127+
* r.sim.water
128+
* r.slope (il y en a 2)
129+
* r.slope.aspect
130+
* r.solute.transport
131+
* r.spread
132+
* r.spreadpath
133+
* r.statistics
134+
* r.stats
135+
* r.stats.quantile.out
136+
* r.stats.quantile.rast
137+
* r.stream.extract
138+
* r.sum
139+
* r.sun
140+
* r.sunhours
141+
* r.sunmask.datetime
142+
* r.sunmask.position
143+
* r.support
144+
* r.surf.area
145+
* r.surf.contour
146+
* r.surf.fractal
147+
* r.surf.gauss
148+
* r.surf.idw
149+
* r.surf.random
150+
* r.terraflow
151+
* r.texture
152+
* r.thin
153+
* r.tile
154+
* r.tileset
155+
* r.to.vect
156+
* r.topidx
157+
* r.topmodel
158+
* r.topmodel.topidxstats
159+
* r.transect
160+
* r.univar
161+
* r.uslek
162+
* r.usler
163+
* r.viewshed
164+
* r.volume
165+
* r.walk.coords
166+
* r.walk.points
167+
* r.walk.rast
168+
* r.water.outlet
169+
* r.watershed
170+
* r.what.color
171+
* r.what.coords
172+
* r.what.points
173+
174+
## Imagery algorithms
175+
176+
* i.albedo
177+
* i.aster.toar
178+
* i.cca
179+
* i.colors.enhance
180+
* i.eb.evapfr
181+
* i.evapo.time
182+
* i.fft
183+
* i.his.rgb
184+
* i.ifft
185+
* i.in.spotvgt
186+
* i.landsat.acca
187+
* i.landsat.toar
188+
* i.pca
189+
* i.rectify
190+
* i.tasscap
191+
--* i.topo.coor.ill
192+
* i.topo.corr
193+
194+
195+
196+
## Vector algorithms
197+
198+
We need to handle gml for output and input for GRASS7 algorithms before creating tests !

0 commit comments

Comments
 (0)