[GRASS-SVN] r69688 - grass/branches/releasebranch_7_2/vector/v.what/testsuite
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Oct 8 19:17:30 PDT 2016
Author: annakrat
Date: 2016-10-08 19:17:30 -0700 (Sat, 08 Oct 2016)
New Revision: 69688
Modified:
grass/branches/releasebranch_7_2/vector/v.what/testsuite/test_vwhat_layers.py
Log:
v.what: add tests for #3172 (merge from trunk, r69687)
Modified: grass/branches/releasebranch_7_2/vector/v.what/testsuite/test_vwhat_layers.py
===================================================================
--- grass/branches/releasebranch_7_2/vector/v.what/testsuite/test_vwhat_layers.py 2016-10-09 02:16:15 UTC (rev 69687)
+++ grass/branches/releasebranch_7_2/vector/v.what/testsuite/test_vwhat_layers.py 2016-10-09 02:17:30 UTC (rev 69688)
@@ -112,7 +112,50 @@
number=8.09
"""
+out4 = """East=634243
+North=226193
+Map=test_vector
+Mapset=...
+Type=Area
+Sq_Meters=633834.281
+Hectares=63.383
+Acres=156.624
+Sq_Miles=0.2447
+Layer=1
+Category=2
+Driver=...
+Database=...
+Table=t1
+Key_column=cat_
+Layer=1
+Category=1
+Driver=...
+Database=...
+Table=t1
+Key_column=cat_
+cat_=1
+text=Petrášová
+number=6
+"""
+
+out5 = """East=634243
+North=226193
+
+Map=test_vector
+Mapset=...
+Type=Area
+Sq_Meters=633834.281
+Hectares=63.383
+Acres=156.624
+Sq_Miles=0.2447
+Layer=2
+Category=3
+Layer=2
+Category=4
+"""
+
+
class TestMultiLayerMap(TestCase):
@classmethod
@@ -156,6 +199,21 @@
except ValueError:
self.fail(msg="No JSON object could be decoded:\n" + self.vwhat.outputs.stdout)
+ def test_selected_layers(self):
+ self.vwhat.inputs.layer = -1
+ self.vwhat.flags['g'].value = True
+ self.vwhat.flags['a'].value = True
+ self.assertModule(self.vwhat)
+ self.assertLooksLike(reference=out3, actual=self.vwhat.outputs.stdout)
+ self.vwhat.inputs.layer = 1
+ self.assertModule(self.vwhat)
+ self.assertLooksLike(reference=out4, actual=self.vwhat.outputs.stdout)
+
+ self.vwhat.inputs.layer = 2
+ self.vwhat.flags['a'].value = False
+ self.assertModule(self.vwhat)
+ self.assertLooksLike(reference=out5, actual=self.vwhat.outputs.stdout)
+
if __name__ == '__main__':
test()
More information about the grass-commit
mailing list