[GRASS-SVN] r74234 - in grass/trunk/scripts/v.to.lines: . testsuite

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 13 00:24:26 PDT 2019


Author: lucadelu
Date: 2019-03-13 00:24:26 -0700 (Wed, 13 Mar 2019)
New Revision: 74234

Added:
   grass/trunk/scripts/v.to.lines/testsuite/
   grass/trunk/scripts/v.to.lines/testsuite/test_v_to_lines.py
Log:
v.to.lines: added test, thanks to Sanjeet Bhatti

Added: grass/trunk/scripts/v.to.lines/testsuite/test_v_to_lines.py
===================================================================
--- grass/trunk/scripts/v.to.lines/testsuite/test_v_to_lines.py	                        (rev 0)
+++ grass/trunk/scripts/v.to.lines/testsuite/test_v_to_lines.py	2019-03-13 07:24:26 UTC (rev 74234)
@@ -0,0 +1,44 @@
+"""
+Created on Sun Jun 09 12:28:03 2018
+
+ at author: Sanjeet Bhatti
+"""
+
+from grass.gunittest.case import TestCase
+from grass.gunittest.main import test
+from grass.gunittest.gmodules import SimpleModule
+
+
+class TestVDToLines(TestCase):
+    """Test v.to.lines script"""
+
+    inputMap = 'boundary_municp'
+    outputMap = 'boundary_municp_lines'
+
+    inputMap2 = 'geodetic_pts'
+    outputMap2 = 'geodetic_pts_lines'
+
+    @classmethod
+    def tearDownClass(cls):
+        """Remove created vector"""
+        cls.runModule('g.remove', type='vector', name=(cls.outputMap,
+                      cls.outputMap2), flags='f')
+
+    def test_area_to_line_check(self):
+        """Area to line conversion test"""
+        module = SimpleModule('v.to.lines', input=self.inputMap,
+                              output=self.outputMap)
+        self.assertModule(module)
+
+        self.assertVectorExists(self.outputMap)
+
+    def test_point_to_line_check(self):
+        """Point to line conversion test"""
+        module = SimpleModule('v.to.lines', input=self.inputMap2,
+                              output=self.outputMap2, overwrite=True)
+        self.assertModule(module)
+
+        self.assertVectorExists(self.outputMap2)
+
+if __name__ == '__main__':
+    test()



More information about the grass-commit mailing list