[GRASS-SVN] r72068 - in grass/trunk: imagery/i.vi/testsuite raster/r.in.ascii/testsuite raster/r.in.poly/testsuite raster3d/r3.flow/testsuite

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Jan 11 05:16:53 PST 2018


Author: lucadelu
Date: 2018-01-11 05:16:53 -0800 (Thu, 11 Jan 2018)
New Revision: 72068

Modified:
   grass/trunk/imagery/i.vi/testsuite/test_vi.py
   grass/trunk/raster/r.in.ascii/testsuite/test_r_in_ascii.py
   grass/trunk/raster/r.in.poly/testsuite/test_rinpoly.py
   grass/trunk/raster3d/r3.flow/testsuite/r3flow_test.py
Log:
testsuite: fixed several problems

Modified: grass/trunk/imagery/i.vi/testsuite/test_vi.py
===================================================================
--- grass/trunk/imagery/i.vi/testsuite/test_vi.py	2018-01-10 22:06:27 UTC (rev 72067)
+++ grass/trunk/imagery/i.vi/testsuite/test_vi.py	2018-01-11 13:16:53 UTC (rev 72068)
@@ -1,12 +1,12 @@
 """
 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
-	            License (>=v2). Read the file COPYING that comes with GRASS
-	            for details.
+                License (>=v2). Read the file COPYING that comes with GRASS
+                for details.
 """
 from grass.gunittest.case import TestCase
 
@@ -24,8 +24,8 @@
 
     @classmethod
     def tearDownClass(cls):
-	cls.runModule("g.remove", flags='f', type="raster", name="ipvi")
-	cls.runModule("g.remove", flags='f', type="raster", name="dvi")
+        cls.runModule("g.remove", flags='f', type="raster", name="ipvi")
+        cls.runModule("g.remove", flags='f', type="raster", name="dvi")
         cls.runModule("g.remove", flags='f', type="raster", name="sr")
         cls.runModule("g.remove", flags='f', type="raster", name="evi")
         cls.runModule("g.remove", flags='f', type="raster", name="evi2")
@@ -33,56 +33,66 @@
         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, output=map_output, viname='ipvi')
-        self.assertRasterMinMax(map=map_output, refmin=0.0454545454545, refmax=0.906666666667,
-	                        msg="ipvi in degrees must be between 0.0454545454545  and 0.906666666667")
+        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,
+                                msg="ipvi in degrees must be between 0.0454545454545  and 0.906666666667")
 
     def test_vinamedvi(self):
         """Testing viname dvi"""
         map_output = 'dvi'
-        self.assertModule('i.vi', red=self.red, nir=self.nir, viname='dvi', output=map_output)
+        self.assertModule('i.vi', red=self.red, nir=self.nir, viname='dvi',
+                          output=map_output)
         self.assertRasterMinMax(map=map_output, refmin=-0.33, refmax=0.56,
-	                        msg="dvi in percent must be between -0.32 and 0.52")
+                                msg="dvi in percent must be between -0.32 and 0.52")
 
     def test_vinamesr(self):
         """Testing viname sr"""
         map_output = 'sr'
-        self.assertModule('i.vi', red=self.red, nir=self.nir, blue=self.blue, output=map_output, viname='sr')
+        self.assertModule('i.vi', red=self.red, nir=self.nir, blue=self.blue,
+                          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")
-	
+                                msg="sr in percent must be between 0.04 and 9.72")
+    
 
     def test_vinameevi(self):
         """Testing viname evi"""
         map_output = 'evi'
-        self.assertModule('i.vi', red=self.red, nir=self.nir, blue=self.blue, output=map_output, viname='evi')
-        self.assertRasterMinMax(map=map_output, refmin=-8.12414050428e+16, refmax=4.45061610234e+17,
-	                        msg="evi in degrees must be between -8.12 and 4.45061610234e+17")
+        self.assertModule('i.vi', red=self.red, nir=self.nir, blue=self.blue,
+                          output=map_output, viname='evi')
+        self.assertRasterMinMax(map=map_output, refmin=-8.12414050428e+16,
+                                refmax=4.45061610234e+17,
+                                msg="evi in degrees must be between -8.12 and 4.45061610234e+17")
 
     def test_vinameevi2(self):
         """Testing viname evi2"""
         map_output = 'evi2'
-        self.assertModule('i.vi', red=self.red, nir=self.nir, output=map_output, viname='evi2')
+        self.assertModule('i.vi', red=self.red, nir=self.nir,
+                          output=map_output, viname='evi2')
         self.assertRasterMinMax(map=map_output, refmin=-0.33, refmax=0.74,
-	                        msg="evi2 in degrees must be between -0.33 and 0.74")
+                                msg="evi2 in degrees must be between -0.33 and 0.74")
 
     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',
-	                        msg="gari in degrees must be between -1.58")
+        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',
+                                msg="gari in degrees must be between -1.58")
 
     def test_vinamegemi(self):
         """Testing viname gemi"""
         map_output = 'gemi'
-        self.assertModule('i.vi', red=self.red, nir=self.nir, output=map_output, viname='gemi')
+        self.assertModule('i.vi', red=self.red, nir=self.nir,
+                          output=map_output, viname='gemi')
         self.assertRasterMinMax(map=map_output, refmin=-221.69, refmax=0.97,
-	                        msg="gemi in degrees must be between -221.69 and 0.97")
+                                msg="gemi in degrees must be between -221.69 and 0.97")
 
 if __name__ == '__main__':
     from grass.gunittest.main import test

Modified: grass/trunk/raster/r.in.ascii/testsuite/test_r_in_ascii.py
===================================================================
--- grass/trunk/raster/r.in.ascii/testsuite/test_r_in_ascii.py	2018-01-10 22:06:27 UTC (rev 72067)
+++ grass/trunk/raster/r.in.ascii/testsuite/test_r_in_ascii.py	2018-01-11 13:16:53 UTC (rev 72068)
@@ -95,7 +95,7 @@
 
     def test_text_delimeter(self):
         """Testing with external file"""
-        self.assertModule('r.in.ascii', input='input_ascii.txt', output=self.ascii_test,
+        self.assertModule('r.in.ascii', input='data/input_ascii.txt', output=self.ascii_test,
                           type='CELL')
         self.assertRasterMinMax(map=self.ascii_test, refmin=1, refmax=5,
 	                        msg="ascii_test in degrees must be between 1 and 5")

Modified: grass/trunk/raster/r.in.poly/testsuite/test_rinpoly.py
===================================================================
--- grass/trunk/raster/r.in.poly/testsuite/test_rinpoly.py	2018-01-10 22:06:27 UTC (rev 72067)
+++ grass/trunk/raster/r.in.poly/testsuite/test_rinpoly.py	2018-01-11 13:16:53 UTC (rev 72068)
@@ -104,7 +104,7 @@
         self.tmpFile.close()
         self.assertModule('r.in.poly', input=self.tmpFile.name, output=self.rinpoly, type='DCELL')
         category = read_command('r.category', map=self.rinpoly, values=[-8, 3, 10.01]).strip()
-        self.assertEqual(first="-8\t{newline}3\tlabel2{newline}10.01\tlabel1".format(newline=os.linesep),
+        self.assertEqual(first="-8\t{newline}3\tlabel2{newline}10.01".format(newline=os.linesep),
                          second=category, msg="Labels do not match")
 
 

Modified: grass/trunk/raster3d/r3.flow/testsuite/r3flow_test.py
===================================================================
--- grass/trunk/raster3d/r3.flow/testsuite/r3flow_test.py	2018-01-10 22:06:27 UTC (rev 72067)
+++ grass/trunk/raster3d/r3.flow/testsuite/r3flow_test.py	2018-01-11 13:16:53 UTC (rev 72068)
@@ -26,13 +26,13 @@
 null_cells=0
 cells=480
 min=0
-max=91
-range=91
+max=89
+range=89
 mean=6.38333333333333
 mean_of_abs=6.38333333333333
-stddev=11.3685848821312
-variance=129.244722222222
-coeff_var=178.097935490306
+stddev=11.3061070026581
+variance=127.828055555556
+coeff_var=177.119169754436
 sum=3064
 """
 



More information about the grass-commit mailing list