瀏覽代碼

v.to.lines: added test, thanks to Sanjeet Bhatti

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@74234 15284696-431f-4ddb-bdfa-cd5b030d7da7
Luca Delucchi 6 年之前
父節點
當前提交
344f8ff951
共有 1 個文件被更改,包括 44 次插入0 次删除
  1. 44 0
      scripts/v.to.lines/testsuite/test_v_to_lines.py

+ 44 - 0
scripts/v.to.lines/testsuite/test_v_to_lines.py

@@ -0,0 +1,44 @@
+"""
+Created on Sun Jun 09 12:28:03 2018
+
+@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()