[GRASS-SVN] r63277 - grass/trunk/raster/r.viewshed/testsuite

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Nov 28 18:59:04 PST 2014


Author: annakrat
Date: 2014-11-28 18:59:03 -0800 (Fri, 28 Nov 2014)
New Revision: 63277

Modified:
   grass/trunk/raster/r.viewshed/testsuite/test_r_viewshed.py
Log:
r.viewshed: rename option - update testsuite

Modified: grass/trunk/raster/r.viewshed/testsuite/test_r_viewshed.py
===================================================================
--- grass/trunk/raster/r.viewshed/testsuite/test_r_viewshed.py	2014-11-29 02:58:40 UTC (rev 63276)
+++ grass/trunk/raster/r.viewshed/testsuite/test_r_viewshed.py	2014-11-29 02:59:03 UTC (rev 63277)
@@ -9,7 +9,7 @@
     @classmethod
     def setUpClass(cls):
         cls.use_temp_region()
-        cls.runModule('g.region', rast='elevation')
+        cls.runModule('g.region', raster='elevation')
 
     @classmethod
     def tearDownClass(cls):
@@ -18,7 +18,7 @@
     def tearDown(cls):
         """Remove viewshed map after each test method"""
         # TODO: eventually, removing maps should be handled through testing framework fucntions
-        cls.runModule('g.remove', flags='f', type='rast',
+        cls.runModule('g.remove', flags='f', type='raster',
                       name=cls.viewshed)
 
     def test_limits(self):
@@ -26,7 +26,7 @@
         obs_elev = '1.72'
         self.assertModule('r.viewshed', input='elevation',
             coordinates=(634720,216180), output=self.viewshed,
-            obs_elev=obs_elev)
+            observer_elevation=obs_elev)
         self.assertRasterMinMax(map=self.viewshed, refmin=0, refmax=180,
                                 msg="Viewing angle above the ground must be between 0 and 180 deg")
 
@@ -35,13 +35,13 @@
         # test e flag
         self.assertModule('r.viewshed', input='elevation', flags='e',
                           coordinates=(634720, 216180), output=self.viewshed,
-                          obs_elev=obs_elev)
+                          observer_elevation=obs_elev)
         minmax = 'null_cells=1963758\nmin=-24.98421\nmax=43.15356'
         self.assertRasterFitsUnivar(raster=self.viewshed, reference=minmax, precision=1e-5)
         # test b flag (#1788)
         self.assertModule('r.viewshed', input='elevation', flags='b',
                           coordinates=(634720, 216180), output=self.viewshed,
-                          obs_elev=obs_elev, overwrite=True)
+                          observer_elevation=obs_elev, overwrite=True)
         minmax = 'min=0\nmax=1\ndatatype=CELL'
         self.assertRasterFitsInfo(raster=self.viewshed, reference=minmax,
                                   msg="Values of binary output must be 0 or 1")
@@ -55,7 +55,7 @@
         obs_elev = '500000'
         self.assertModule('r.viewshed', input='elevation',
             coordinates=(634720,216180), output=self.viewshed,
-            obs_elev=obs_elev)
+            observer_elevation=obs_elev)
         self.assertRasterMinMax(map=self.viewshed, refmin=0, refmax=180,
             msg="Viewing angle above the ground must be between 0 and 180 deg")
 
@@ -67,7 +67,7 @@
 
         g.region n=216990 s=215520 w=633730 e=635950 res=10 -p
         r.out.ascii elevation out=data/elevation.ascii
-        r.viewshed input=elevation output=lake_viewshed coordinates=634720,216180 obs_elev=1.72
+        r.viewshed input=elevation output=lake_viewshed coordinates=634720,216180 observer_elevation=1.72
         r.out.ascii lake_viewshed out=data/lake_viewshed.ascii
 
     """
@@ -91,10 +91,10 @@
     @classmethod
     def tearDownClass(cls):
         cls.del_temp_region()
-        cls.runModule('g.remove', flags='f', type='rast',
+        cls.runModule('g.remove', flags='f', type='raster',
                       name=cls.elevation)
         if cls.to_remove:
-            cls.runModule('g.remove', flags='f', type='rast',
+            cls.runModule('g.remove', flags='f', type='raster',
                           name=','.join(cls.to_remove))
 
     def test_viewshed(self):
@@ -107,7 +107,7 @@
         self.to_remove.append(ref_viewshed)
 
         self.assertModule('r.viewshed', input=self.elevation,
-                          coordinates=(634720,216180), output=viewshed, obs_elev=obs_elev)
+                          coordinates=(634720,216180), output=viewshed, observer_elevation=obs_elev)
         self.to_remove.append(viewshed)
 
         # check we have expected values



More information about the grass-commit mailing list