[GRASS-SVN] r74483 - grass/trunk/imagery/i.vi/testsuite
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed May 15 14:01:46 PDT 2019
Author: annakrat
Date: 2019-05-15 14:01:46 -0700 (Wed, 15 May 2019)
New Revision: 74483
Modified:
grass/trunk/imagery/i.vi/testsuite/test_vi.py
Log:
i.vi: fix testsuite
Modified: grass/trunk/imagery/i.vi/testsuite/test_vi.py
===================================================================
--- grass/trunk/imagery/i.vi/testsuite/test_vi.py 2019-05-15 20:56:35 UTC (rev 74482)
+++ grass/trunk/imagery/i.vi/testsuite/test_vi.py 2019-05-15 21:01:46 UTC (rev 74483)
@@ -1,7 +1,7 @@
"""
Name: i.vi test
Purpose: Tests i.vi and its flags/options.
-
+
Author: Sunveer Singh, Google Code-in 2017
Copyright: (C) 2017 by Sunveer Singh and the GRASS Development Team
Licence: This program is free software under the GNU General Public
@@ -10,12 +10,13 @@
"""
from grass.gunittest.case import TestCase
+
class TestReport(TestCase):
- blue='lsat5_1987_10'
- green='lsat5_1987_20'
- red='lsat5_1987_30'
- nir= 'lsat5_1987_40'
-
+ blue = 'lsat5_1987_10'
+ green = 'lsat5_1987_20'
+ red = 'lsat5_1987_30'
+ nir = 'lsat5_1987_40'
+
@classmethod
def setUpClass(cls):
"""Use temporary region settings"""
@@ -32,12 +33,11 @@
cls.runModule("g.remove", flags='f', type="raster", name="gari")
cls.runModule("g.remove", flags='f', type="raster", name="gemi")
cls.del_temp_region()
-
-
+
def test_vinameipvi(self):
"""Testing viname ipvi"""
map_output = 'ipvi'
- self.assertModule('i.vi', red=self.red, nir=self.nir,
+ self.assertModule('i.vi', red=self.red, nir=self.nir,
output=map_output, viname='ipvi')
self.assertRasterMinMax(map=map_output, refmin=0.0454545454545,
refmax=0.906666666667,
@@ -58,7 +58,6 @@
output=map_output, viname='sr')
self.assertRasterMinMax(map=map_output, refmin=0.04, refmax=9.73,
msg="sr in percent must be between 0.04 and 9.72")
-
def test_vinameevi(self):
"""Testing viname evi"""
@@ -77,13 +76,13 @@
self.assertRasterMinMax(map=map_output, refmin=-0.33, refmax=0.74,
msg="evi2 in degrees must be between -0.33 and 0.74")
- def test_vinamegari(self):
+ def test_vinamegari(self):
"""Testing viname gari"""
map_output = 'gari'
self.assertModule('i.vi', red=self.red, nir=self.nir, blue=self.blue,
green=self.green, output=map_output, viname='gari')
self.assertRasterMinMax(map=map_output, refmin=-1.58244128083e+17,
- refmax='inf',
+ refmax=float('inf'),
msg="gari in degrees must be between -1.58")
def test_vinamegemi(self):
@@ -96,4 +95,4 @@
if __name__ == '__main__':
from grass.gunittest.main import test
- test()
+ test()
More information about the grass-commit
mailing list