[GRASS-SVN] r61191 - grass/trunk/raster/r.gwflow/testsuite

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Jul 8 07:36:31 PDT 2014


Author: huhabla
Date: 2014-07-08 07:36:31 -0700 (Tue, 08 Jul 2014)
New Revision: 61191

Modified:
   grass/trunk/raster/r.gwflow/testsuite/validation_7x7_grid.py
   grass/trunk/raster/r.gwflow/testsuite/validation_excavation.py
Log:
Use runModule() outside test functions

Modified: grass/trunk/raster/r.gwflow/testsuite/validation_7x7_grid.py
===================================================================
--- grass/trunk/raster/r.gwflow/testsuite/validation_7x7_grid.py	2014-07-08 14:33:17 UTC (rev 61190)
+++ grass/trunk/raster/r.gwflow/testsuite/validation_7x7_grid.py	2014-07-08 14:36:31 UTC (rev 61191)
@@ -16,22 +16,21 @@
     def setUpClass(cls):
         """Use temporary region settings"""
         grass.use_temp_region()
+        cls.runModule("g.region", res=100, n=700, s=0, w=0, e=700)
 
     def setUp(self):
         """Set region and create input data for transient groundwater flow computation
         """
-        self.assertModule("g.region", res=100, n=700, s=0, w=0, e=700)
+        self.runModule("r.mapcalc", expression="phead=50")
+        self.runModule("r.mapcalc", expression="status=if(col() == 1 || col() == 7 , 2, 1)")
+        self.runModule("r.mapcalc", expression="well=if((row() == 4 && col() == 4), -0.1, 0)")
+        self.runModule("r.mapcalc", expression="hydcond=0.0005")
+        self.runModule("r.mapcalc", expression="recharge=0")
+        self.runModule("r.mapcalc", expression="top_conf=20")
+        self.runModule("r.mapcalc", expression="bottom=0")
+        self.runModule("r.mapcalc", expression="s=0.0001")
+        self.runModule("r.mapcalc", expression="null=0.0")
 
-        self.assertModule("r.mapcalc", expression="phead=50")
-        self.assertModule("r.mapcalc", expression="status=if(col() == 1 || col() == 7 , 2, 1)")
-        self.assertModule("r.mapcalc", expression="well=if((row() == 4 && col() == 4), -0.1, 0)")
-        self.assertModule("r.mapcalc", expression="hydcond=0.0005")
-        self.assertModule("r.mapcalc", expression="recharge=0")
-        self.assertModule("r.mapcalc", expression="top_conf=20")
-        self.assertModule("r.mapcalc", expression="bottom=0")
-        self.assertModule("r.mapcalc", expression="s=0.0001")
-        self.assertModule("r.mapcalc", expression="null=0.0")
-
     def test_transient(self):
         #First compute the groundwater flow
         self.assertModule("r.gwflow", flags="f", solver="cholesky", top="top_conf", bottom="bottom", phead="phead",\

Modified: grass/trunk/raster/r.gwflow/testsuite/validation_excavation.py
===================================================================
--- grass/trunk/raster/r.gwflow/testsuite/validation_excavation.py	2014-07-08 14:33:17 UTC (rev 61190)
+++ grass/trunk/raster/r.gwflow/testsuite/validation_excavation.py	2014-07-08 14:36:31 UTC (rev 61191)
@@ -17,26 +17,24 @@
     def setUpClass(cls):
         """Use temporary region settings"""
         grass.use_temp_region()
+        cls.runModule("g.region", flags="p",  res=50, n=950, s=0, w=0, e=2000)
 
     def setUp(self):
         """Set region and create input data for steady state groundwater flow computation
         """
-
-        self.assertModule("g.region", flags="p",  res=50, n=950, s=0, w=0, e=2000)
-
-        self.assertModule("r.mapcalc", expression="phead= if(row() == 19, 5, 3)")
-        self.assertModule("r.mapcalc", expression="status=if((col() == 1 && row() == 13) ||\
+        self.runModule("r.mapcalc", expression="phead= if(row() == 19, 5, 3)")
+        self.runModule("r.mapcalc", expression="status=if((col() == 1 && row() == 13) ||\
                                       (col() == 1 && row() == 14) ||\
                                       (col() == 2 && row() == 13) ||\
                                       (col() == 2 && row() == 14) ||\
                                       (row() == 19), 2, 1)")
 
-        self.assertModule("r.mapcalc", expression="hydcond=0.001")
-        self.assertModule("r.mapcalc", expression="recharge=0.000000006")
-        self.assertModule("r.mapcalc", expression="top=20")
-        self.assertModule("r.mapcalc", expression="bottom=0")
-        self.assertModule("r.mapcalc", expression="poros=0.1")
-        self.assertModule("r.mapcalc", expression="null=0.0")
+        self.runModule("r.mapcalc", expression="hydcond=0.001")
+        self.runModule("r.mapcalc", expression="recharge=0.000000006")
+        self.runModule("r.mapcalc", expression="top=20")
+        self.runModule("r.mapcalc", expression="bottom=0")
+        self.runModule("r.mapcalc", expression="poros=0.1")
+        self.runModule("r.mapcalc", expression="null=0.0")
 
     def test_steady_state(self):
         #compute a steady state groundwater flow



More information about the grass-commit mailing list