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

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Jul 20 06:52:09 PDT 2014


Author: huhabla
Date: 2014-07-20 06:52:09 -0700 (Sun, 20 Jul 2014)
New Revision: 61284

Modified:
   grass/trunk/raster/r.gwflow/testsuite/validation_7x7_grid.py
   grass/trunk/raster/r.gwflow/testsuite/validation_excavation.py
Log:
r.gwflow: testsuite: Use class functions to run modules.


Modified: grass/trunk/raster/r.gwflow/testsuite/validation_7x7_grid.py
===================================================================
--- grass/trunk/raster/r.gwflow/testsuite/validation_7x7_grid.py	2014-07-20 00:18:36 UTC (rev 61283)
+++ grass/trunk/raster/r.gwflow/testsuite/validation_7x7_grid.py	2014-07-20 13:52:09 UTC (rev 61284)
@@ -7,7 +7,6 @@
 
 @author Soeren Gebbert
 """
-import grass.script as grass
 from grass.gunittest.case import TestCase
 
 class Validation7x7Grid(TestCase):
@@ -15,17 +14,17 @@
     @classmethod
     def setUpClass(cls):
         """Use temporary region settings"""
-        grass.use_temp_region()
+        cls.use_temp_region()
         cls.runModule("g.region", res=100, n=700, s=0, w=0, e=700)
 
     @classmethod
     def tearDownClass(cls):
         """!Remove the temporary region
         """
-        grass.del_temp_region()
+        cls.del_temp_region()
 
     def setUp(self):
-        """Set region and create input data for transient groundwater flow computation
+        """Create input data for transient groundwater flow computation
         """
         self.runModule("r.mapcalc", expression="phead=50")
         self.runModule("r.mapcalc", expression="status=if(col() == 1 || col() == 7 , 2, 1)")
@@ -38,12 +37,12 @@
         self.runModule("r.mapcalc", expression="null=0.0")
 
     def test_transient(self):
-        #First compute the groundwater flow
+        #First compute the groundwater flow after 500 seconds to have initial conditions
         self.assertModule("r.gwflow", flags="f", solver="cholesky", top="top_conf", bottom="bottom", phead="phead",\
          status="status", hc_x="hydcond", hc_y="hydcond", q="well", s="s",\
          recharge="recharge", output="gwresult_conf", dt=500, type="confined", budget="water_budget",  overwrite=True)
 
-        # loop over the timesteps
+        # loop over the timesteps each 500 seconds
         for i in range(20):
             self.assertModule("r.gwflow",  flags="f", solver="cholesky", top="top_conf", bottom="bottom", phead="gwresult_conf",\
              status="status", hc_x="hydcond", hc_y="hydcond", q="well", s="s",\

Modified: grass/trunk/raster/r.gwflow/testsuite/validation_excavation.py
===================================================================
--- grass/trunk/raster/r.gwflow/testsuite/validation_excavation.py	2014-07-20 00:18:36 UTC (rev 61283)
+++ grass/trunk/raster/r.gwflow/testsuite/validation_excavation.py	2014-07-20 13:52:09 UTC (rev 61284)
@@ -8,7 +8,6 @@
 @author Soeren Gebbert
 """
 
-import grass.script as grass
 from grass.gunittest.case import TestCase
 
 class ValidationExcavation(TestCase):
@@ -16,17 +15,17 @@
     @classmethod
     def setUpClass(cls):
         """Use temporary region settings"""
-        grass.use_temp_region()
+        cls.use_temp_region()
         cls.runModule("g.region", flags="p",  res=50, n=950, s=0, w=0, e=2000)
 
     @classmethod
     def tearDownClass(cls):
         """!Remove the temporary region
         """
-        grass.del_temp_region()
+        cls.del_temp_region()
 
     def setUp(self):
-        """Set region and create input data for steady state groundwater flow computation
+        """Create input data for steady state groundwater flow computation
         """
         self.runModule("r.mapcalc", expression="phead= if(row() == 19, 5, 3)")
         self.runModule("r.mapcalc", expression="status=if((col() == 1 && row() == 13) ||\



More information about the grass-commit mailing list