Преглед изворни кода

v.what: fix tests - do not test database path

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@62306 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová пре 10 година
родитељ
комит
cef6b69e17
2 измењених фајлова са 37 додато и 37 уклоњено
  1. 22 22
      vector/v.what/testsuite/test_vwhat_layers.py
  2. 15 15
      vector/v.what/testsuite/test_vwhat_ncspm.py

+ 22 - 22
vector/v.what/testsuite/test_vwhat_layers.py

@@ -6,7 +6,7 @@ out1 = """East: 634243
 North: 226193
 ------------------------------------------------------------------
 Map: test_vector 
-Mapset: vector_what
+Mapset: ...
 Type: Area
 Sq Meters: 633834.281
 Hectares: 63.383
@@ -27,7 +27,7 @@ out2 = """East: 634243
 North: 226193
 ------------------------------------------------------------------
 Map: test_vector 
-Mapset: vector_what
+Mapset: ...
 Type: Area
 Sq Meters: 633834.281
 Hectares: 63.383
@@ -36,15 +36,15 @@ Sq Miles: 0.2447
 Layer: 1
 Category: 2
 
-Driver: sqlite
-Database: /home/anna/grassdata/nc_spm_08_grass7_test/vector_what/sqlite/sqlite.db
+Driver: ...
+Database: ...
 Table: t1
 Key column: cat_
 Layer: 1
 Category: 1
 
-Driver: sqlite
-Database: /home/anna/grassdata/nc_spm_08_grass7_test/vector_what/sqlite/sqlite.db
+Driver: ...
+Database: ...
 Table: t1
 Key column: cat_
 cat_ : 1
@@ -53,15 +53,15 @@ number : 6
 Layer: 2
 Category: 3
 
-Driver: sqlite
-Database: /home/anna/grassdata/nc_spm_08_grass7_test/vector_what/sqlite/sqlite.db
+Driver: ...
+Database: ...
 Table: t2
 Key column: cat_
 Layer: 2
 Category: 4
 
-Driver: sqlite
-Database: /home/anna/grassdata/nc_spm_08_grass7_test/vector_what/sqlite/sqlite.db
+Driver: ...
+Database: ...
 Table: t2
 Key column: cat_
 cat_ : 4
@@ -73,7 +73,7 @@ out3 = """East=634243
 North=226193
 
 Map=test_vector
-Mapset=vector_what
+Mapset=...
 Type=Area
 Sq_Meters=633834.281
 Hectares=63.383
@@ -81,14 +81,14 @@ Acres=156.624
 Sq_Miles=0.2447
 Layer=1
 Category=2
-Driver=sqlite
-Database=/home/anna/grassdata/nc_spm_08_grass7_test/vector_what/sqlite/sqlite.db
+Driver=...
+Database=...
 Table=t1
 Key_column=cat_
 Layer=1
 Category=1
-Driver=sqlite
-Database=/home/anna/grassdata/nc_spm_08_grass7_test/vector_what/sqlite/sqlite.db
+Driver=...
+Database=...
 Table=t1
 Key_column=cat_
 cat_=1
@@ -96,14 +96,14 @@ text=xxx
 number=6
 Layer=2
 Category=3
-Driver=sqlite
-Database=/home/anna/grassdata/nc_spm_08_grass7_test/vector_what/sqlite/sqlite.db
+Driver=...
+Database=...
 Table=t2
 Key_column=cat_
 Layer=2
 Category=4
-Driver=sqlite
-Database=/home/anna/grassdata/nc_spm_08_grass7_test/vector_what/sqlite/sqlite.db
+Driver=...
+Database=...
 Table=t2
 Key_column=cat_
 cat_=4
@@ -133,16 +133,16 @@ class TestMultiLayerMap(TestCase):
 
     def test_run(self):
         self.assertModule(self.vwhat)
-        self.assertMultiLineEqual(first=out1, second=self.vwhat.outputs.stdout)
+        self.assertLooksLike(reference=out1, actual=self.vwhat.outputs.stdout)
 
     def test_print_options(self):
         self.vwhat.flags['a'].value = True
         self.assertModule(self.vwhat)
-        self.assertMultiLineEqual(first=out2, second=self.vwhat.outputs.stdout)
+        self.assertLooksLike(reference=out2, actual=self.vwhat.outputs.stdout)
 
         self.vwhat.flags['g'].value = True
         self.assertModule(self.vwhat)
-        self.assertMultiLineEqual(first=out3, second=self.vwhat.outputs.stdout)
+        self.assertLooksLike(reference=out3, actual=self.vwhat.outputs.stdout)
 
 
 if __name__ == '__main__':

+ 15 - 15
vector/v.what/testsuite/test_vwhat_ncspm.py

@@ -44,8 +44,8 @@ Length: 2321.407296
 Layer: 1
 Category: 231
 
-Driver: sqlite
-Database: /home/anna/grassdata/nc_spm_08_grass7_test/PERMANENT/sqlite/sqlite.db
+Driver: ...
+Database: ...
 Table: roadsmajor
 Key column: cat
 cat : 231
@@ -64,8 +64,8 @@ Point height: 121.920000
 Layer: 1
 Category: 96
 
-Driver: sqlite
-Database: /home/anna/grassdata/nc_spm_08_grass7_test/PERMANENT/sqlite/sqlite.db
+Driver: ...
+Database: ...
 Table: precip_30ynormals_3d
 Key column: cat
 cat : 96
@@ -97,8 +97,8 @@ Sq Miles: 0.0036
 Layer: 1
 Category: 7168
 
-Driver: sqlite
-Database: /home/anna/grassdata/nc_spm_08_grass7_test/PERMANENT/sqlite/sqlite.db
+Driver: ...
+Database: ...
 Table: lakes
 Key column: cat
 cat : 7168
@@ -121,8 +121,8 @@ Id=231
 Length=2321.407296
 Layer=1
 Category=231
-Driver=sqlite
-Database=/home/anna/grassdata/nc_spm_08_grass7_test/PERMANENT/sqlite/sqlite.db
+Driver=...
+Database=...
 Table=roadsmajor
 Key_column=cat
 cat=231
@@ -140,8 +140,8 @@ Id=96
 Point_height=121.920000
 Layer=1
 Category=96
-Driver=sqlite
-Database=/home/anna/grassdata/nc_spm_08_grass7_test/PERMANENT/sqlite/sqlite.db
+Driver=...
+Database=...
 Table=precip_30ynormals_3d
 Key_column=cat
 cat=96
@@ -172,8 +172,8 @@ Acres=2.322
 Sq_Miles=0.0036
 Layer=1
 Category=7168
-Driver=sqlite
-Database=/home/anna/grassdata/nc_spm_08_grass7_test/PERMANENT/sqlite/sqlite.db
+Driver=...
+Database=...
 Table=lakes
 Key_column=cat
 cat=7168
@@ -223,16 +223,16 @@ class TestNCMaps(TestCase):
     def test_print_options(self):
         self.vwhat.flags['a'].value = True
         self.assertModule(self.vwhat)
-        self.assertMultiLineEqual(first=out2, second=self.vwhat.outputs.stdout)
+        self.assertLooksLike(reference=out2, actual=self.vwhat.outputs.stdout)
 
         self.vwhat.flags['g'].value = True
         self.assertModule(self.vwhat)
-        self.assertMultiLineEqual(first=out3, second=self.vwhat.outputs.stdout)
+        self.assertLooksLike(reference=out3, actual=self.vwhat.outputs.stdout)
 
     def test_threshold(self):
         self.vwhat.inputs['distance'].value = 100
         self.assertModule(self.vwhat)
-        self.assertMultiLineEqual(first=out4, second=self.vwhat.outputs.stdout)
+        self.assertLooksLike(reference=out4, actual=self.vwhat.outputs.stdout)
 
 
 if __name__ == '__main__':