[GRASS-SVN] r66074 - grass/trunk/temporal/t.connect/testsuite

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Aug 31 04:00:45 PDT 2015


Author: huhabla
Date: 2015-08-31 04:00:45 -0700 (Mon, 31 Aug 2015)
New Revision: 66074

Modified:
   grass/trunk/temporal/t.connect/testsuite/test_distr_tgis_db_raster.py
   grass/trunk/temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py
   grass/trunk/temporal/t.connect/testsuite/test_distr_tgis_db_vector.py
Log:
temporal modules t.connect: Fixed tests


Modified: grass/trunk/temporal/t.connect/testsuite/test_distr_tgis_db_raster.py
===================================================================
--- grass/trunk/temporal/t.connect/testsuite/test_distr_tgis_db_raster.py	2015-08-31 10:40:37 UTC (rev 66073)
+++ grass/trunk/temporal/t.connect/testsuite/test_distr_tgis_db_raster.py	2015-08-31 11:00:45 UTC (rev 66074)
@@ -22,52 +22,29 @@
     @classmethod
     def setUpClass(cls):
         os.putenv("GRASS_OVERWRITE", "1")
-        for i in range(1, 5):
+        for i in range(1, 7):
             mapset_name = "test%i" % i
             cls.runModule("g.mapset", flags="c", mapset=mapset_name)
             cls.mapsets_to_remove.append(mapset_name)
             cls.runModule("g.region", s=0, n=80,
                           w=0, e=120, b=0, t=50, res=10, res3=10)
+            cls.runModule("t.connect", flags="d")
             cls.runModule("t.info", flags="s")
             cls.runModule("r.mapcalc", expression="a1 = 100")
             cls.runModule("r.mapcalc", expression="a2 = 200")
             cls.runModule("r.mapcalc", expression="a3 = 300")
-
             cls.runModule("t.create", type="strds", temporaltype="absolute",
                           output="A", title="A test", description="A test")
             cls.runModule("t.register", flags="i", type="raster", input="A",
                           maps="a1,a2,a3",
                           start="2001-01-01", increment="%i months" % i)
 
-        # Here we reuse two mapset to share a temporal databse between mapsets
-        tgis.init()
-        ciface = tgis.get_tgis_c_library_interface()
-        cls.runModule("g.mapset", flags="c", mapset="test5")
-        driver = ciface.get_driver_name("test1")
-        database = ciface.get_database_name("test1")
-        cls.runModule("t.connect", driver=driver, database=database)
+        # Add the new mapsets to the search path
+        for mapset in cls.mapsets_to_remove:
+            cls.runModule("g.mapset", mapset=mapset)
+            cls.runModule("g.mapsets", operation="add", mapset=','.join(cls.mapsets_to_remove))
 
-        cls.runModule("g.mapset", flags="c", mapset="test6")
-        driver = ciface.get_driver_name("test2")
-        database = ciface.get_database_name("test2")
-        cls.runModule("t.connect", driver=driver, database=database)
 
-        for i in range(5, 7):
-            mapset_name = "test%i" % i
-            cls.runModule("g.mapset", mapset=mapset_name)
-            cls.runModule("g.region", s=0, n=80,
-                          w=0, e=120, b=0, t=50, res=10, res3=10)
-            cls.mapsets_to_remove.append(mapset_name)
-            cls.runModule("r.mapcalc", expression="a1 = 100")
-            cls.runModule("r.mapcalc", expression="a2 = 200")
-            cls.runModule("r.mapcalc", expression="a3 = 300")
-
-            cls.runModule("t.create", type="strds", temporaltype="absolute",
-                          output="A", title="A test", description="A test")
-            cls.runModule("t.register", flags="i", type="raster", input="A",
-                          maps="a1,a2,a3",
-                          start="2001-01-01", increment="%i months" % i)
-
     @classmethod
     def tearDownClass(cls):
         gisenv = SimpleModule('g.gisenv', get='GISDBASE')

Modified: grass/trunk/temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py
===================================================================
--- grass/trunk/temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py	2015-08-31 10:40:37 UTC (rev 66073)
+++ grass/trunk/temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py	2015-08-31 11:00:45 UTC (rev 66074)
@@ -31,7 +31,9 @@
             cls.runModule("r3.mapcalc", expression="a1 = 100")
             cls.runModule("r3.mapcalc", expression="a2 = 200")
             cls.runModule("r3.mapcalc", expression="a3 = 300")
-
+            # Create the temporal database
+            cls.runModule("t.connect", flags="d")
+            cls.runModule("t.info", flags="s")
             cls.runModule("t.create", type="str3ds", temporaltype="absolute",
                           output="A", title="A test3d", description="A test3d")
             cls.runModule(
@@ -39,6 +41,11 @@
                 maps="a1,a2,a3",
                 start="2001-01-01", increment="%i months" % i)
 
+        # Add the new mapsets to the search path
+        for mapset in cls.mapsets_to_remove:
+            cls.runModule("g.mapset", mapset=mapset)
+            cls.runModule("g.mapsets", operation="add", mapset=','.join(cls.mapsets_to_remove))
+
     @classmethod
     def tearDownClass(cls):
         gisenv = SimpleModule('g.gisenv', get='GISDBASE')

Modified: grass/trunk/temporal/t.connect/testsuite/test_distr_tgis_db_vector.py
===================================================================
--- grass/trunk/temporal/t.connect/testsuite/test_distr_tgis_db_vector.py	2015-08-31 10:40:37 UTC (rev 66073)
+++ grass/trunk/temporal/t.connect/testsuite/test_distr_tgis_db_vector.py	2015-08-31 11:00:45 UTC (rev 66074)
@@ -31,13 +31,20 @@
             cls.runModule("v.random", output="a1", npoints=20)
             cls.runModule("v.random", output="a2", npoints=20)
             cls.runModule("v.random", output="a3", npoints=20)
-
+            # Create the temporal database
+            cls.runModule("t.connect", flags="d")
+            cls.runModule("t.info", flags="s")
             cls.runModule("t.create", type="stvds", temporaltype="absolute",
                           output="A", title="A testvect", description="A testvect")
             cls.runModule("t.register", flags="i", type="vector", input="A",
                           maps="a1,a2,a3",
                           start="2001-01-01", increment="%i months" % i)
 
+        # Add the new mapsets to the search path
+        for mapset in cls.mapsets_to_remove:
+            cls.runModule("g.mapset", mapset=mapset)
+            cls.runModule("g.mapsets", operation="add", mapset=','.join(cls.mapsets_to_remove))
+
     @classmethod
     def tearDownClass(cls):
         gisenv = SimpleModule('g.gisenv', get='GISDBASE')



More information about the grass-commit mailing list