浏览代码

t.connect: fixed testsuite, return to the right mapset

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@67888 15284696-431f-4ddb-bdfa-cd5b030d7da7
Luca Delucchi 9 年之前
父节点
当前提交
212846fd1c

+ 4 - 1
temporal/t.connect/testsuite/test_distr_tgis_db_raster.py

@@ -12,13 +12,15 @@ from grass.gunittest.case import TestCase
 from grass.gunittest.gmodules import SimpleModule
 from grass.gunittest.utils import silent_rmtree
 import os
-import grass.temporal as tgis
 
 
 class TestRasterExtraction(TestCase):
 
     mapsets_to_remove = []
     outfile = 'rastlist.txt'
+    gisenv = SimpleModule('g.gisenv', get='MAPSET')
+    TestCase.runModule(gisenv, expecting_stdout=True)
+    old_mapset = gisenv.outputs.stdout.strip()
 
     @classmethod
     def setUpClass(cls):
@@ -54,6 +56,7 @@ class TestRasterExtraction(TestCase):
         gisenv = SimpleModule('g.gisenv', get='LOCATION_NAME')
         cls.runModule(gisenv, expecting_stdout=True)
         location = gisenv.outputs.stdout.strip()
+        cls.runModule("g.mapset", mapset=cls.old_mapset)
         for mapset_name in cls.mapsets_to_remove:
             mapset_path = os.path.join(gisdbase, location, mapset_name)
             silent_rmtree(mapset_path)

+ 4 - 0
temporal/t.connect/testsuite/test_distr_tgis_db_raster3d.py

@@ -18,6 +18,9 @@ class testRaster3dExtraction(TestCase):
 
     mapsets_to_remove = []
     outfile = 'rast3dlist.txt'
+    gisenv = SimpleModule('g.gisenv', get='MAPSET')
+    TestCase.runModule(gisenv, expecting_stdout=True)
+    old_mapset = gisenv.outputs.stdout.strip()
 
     @classmethod
     def setUpClass(cls):
@@ -55,6 +58,7 @@ class testRaster3dExtraction(TestCase):
         gisenv = SimpleModule('g.gisenv', get='LOCATION_NAME')
         cls.runModule(gisenv, expecting_stdout=True)
         location = gisenv.outputs.stdout.strip()
+        cls.runModule("g.mapset", mapset=cls.old_mapset)
         for mapset_name in cls.mapsets_to_remove:
             mapset_path = os.path.join(gisdbase, location, mapset_name)
             silent_rmtree(mapset_path)

+ 4 - 0
temporal/t.connect/testsuite/test_distr_tgis_db_vector.py

@@ -18,6 +18,9 @@ class TestRasterExtraction(TestCase):
 
     mapsets_to_remove = []
     outfile = 'vectlist.txt'
+    gisenv = SimpleModule('g.gisenv', get='MAPSET')
+    TestCase.runModule(gisenv, expecting_stdout=True)
+    old_mapset = gisenv.outputs.stdout.strip()
 
     @classmethod
     def setUpClass(cls):
@@ -54,6 +57,7 @@ class TestRasterExtraction(TestCase):
         gisenv = SimpleModule('g.gisenv', get='LOCATION_NAME')
         cls.runModule(gisenv, expecting_stdout=True)
         location = gisenv.outputs.stdout.strip()
+        cls.runModule("g.mapset", mapset=cls.old_mapset)
         for mapset_name in cls.mapsets_to_remove:
             mapset_path = os.path.join(gisdbase, location, mapset_name)
             silent_rmtree(mapset_path)