[GRASS-SVN] r61175 - grass/trunk/lib/python/temporal/testsuite
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Jul 7 14:25:10 PDT 2014
Author: wenzeslaus
Date: 2014-07-07 14:25:10 -0700 (Mon, 07 Jul 2014)
New Revision: 61175
Modified:
grass/trunk/lib/python/temporal/testsuite/unittests_register.py
Log:
testing: use runModule for general runs, use name TestCase and simpler imports (introduced in r61174)
Modified: grass/trunk/lib/python/temporal/testsuite/unittests_register.py
===================================================================
--- grass/trunk/lib/python/temporal/testsuite/unittests_register.py 2014-07-07 21:22:27 UTC (rev 61174)
+++ grass/trunk/lib/python/temporal/testsuite/unittests_register.py 2014-07-07 21:25:10 UTC (rev 61175)
@@ -11,33 +11,32 @@
import grass.script as grass
import grass.temporal as tgis
-from gunittest.case import GrassTestCase
+import gunittest
import datetime
-class TestRegisterFunctions(GrassTestCase):
+class TestRegisterFunctions(gunittest.TestCase):
+
@classmethod
def setUpClass(cls):
"""!Initiate the temporal GIS and set the region
"""
# Use always the current mapset as temporal database
- cls.assertModule("g.gisenv", set="TGIS_USE_CURRENT_MAPSET=1")
+ cls.runModule("g.gisenv", set="TGIS_USE_CURRENT_MAPSET=1")
tgis.init()
grass.overwrite = True
grass.use_temp_region()
- cls.assertModule("g.region", n=80.0, s=0.0, e=120.0,
- w=0.0, t=1.0, b=0.0, res=10.0)
+ cls.runModule("g.region", n=80.0, s=0.0, e=120.0,
+ w=0.0, t=1.0, b=0.0, res=10.0)
def setUp(self):
"""!Create the test maps and the space time raster datasets
"""
- self.assertModule("r.mapcalc", overwrite=True, quiet=True,
- expression="register_map_1 = 1")
- self.assertModule("r.mapcalc", overwrite=True, quiet=True,
- expression="register_map_2 = 2")
- self.assertEqual(ret, 0)
-
-
+ self.runModule("r.mapcalc", overwrite=True, quiet=True,
+ expression="register_map_1 = 1")
+ self.runModule("r.mapcalc", overwrite=True, quiet=True,
+ expression="register_map_2 = 2")
+
self.strds_abs = tgis.open_new_stds(name="register_test_abs", type="strds", temporaltype="absolute",
title="Test strds", descr="Test strds", semantic="field")
self.strds_rel = tgis.open_new_stds(name="register_test_rel", type="strds", temporaltype="relative",
@@ -301,7 +300,4 @@
grass.del_temp_region()
if __name__ == '__main__':
- from gunittest.main import test
- test()
-
-
+ gunittest.test()
More information about the grass-commit
mailing list