[GRASS-SVN] r74248 - in grass/trunk/scripts/r.out.xyz: . testsuite

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 13 11:51:50 PDT 2019


Author: lucadelu
Date: 2019-03-13 11:51:50 -0700 (Wed, 13 Mar 2019)
New Revision: 74248

Added:
   grass/trunk/scripts/r.out.xyz/testsuite/
   grass/trunk/scripts/r.out.xyz/testsuite/test_r_out_xyz.py
Log:
r.out.xyz: added test, thanks to Sanjeet Bhatti

Added: grass/trunk/scripts/r.out.xyz/testsuite/test_r_out_xyz.py
===================================================================
--- grass/trunk/scripts/r.out.xyz/testsuite/test_r_out_xyz.py	                        (rev 0)
+++ grass/trunk/scripts/r.out.xyz/testsuite/test_r_out_xyz.py	2019-03-13 18:51:50 UTC (rev 74248)
@@ -0,0 +1,43 @@
+"""
+Created on Sun Jun 08 10:11:18 2018
+
+ at author: Sanjeet Bhatti
+"""
+
+from grass.gunittest.case import TestCase
+from grass.gunittest.main import test
+from grass.gunittest.gmodules import SimpleModule
+
+import os
+
+
+class TestROutXyz(TestCase):
+    """Test r.out.xyz script"""
+
+    mapName = 'elev_lid792_1m'
+    csvFile = 'elev_lid792_1m.csv'
+
+    @classmethod
+    def setUpClass(cls):
+        """Create maps in a small region."""
+        cls.use_temp_region()
+        cls.runModule('g.region', raster=cls.mapName, flags='p')
+
+    @classmethod
+    def tearDownClass(cls):
+        """Remove temporary region"""
+        cls.del_temp_region()
+
+        if (os.path.isfile(cls.csvFile)):
+            os.remove(cls.csvFile)
+
+    def test_r_out_xyz(self):
+        """ASCII text file test"""
+        module = SimpleModule('r.out.xyz', input=self.mapName,
+                              output=self.csvFile, separator=",")
+        self.assertModule(module)
+
+        self.assertFileExists(filename=self.csvFile)
+
+if __name__ == '__main__':
+    test()


Property changes on: grass/trunk/scripts/r.out.xyz/testsuite/test_r_out_xyz.py
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/x-python
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property


More information about the grass-commit mailing list