[GRASS-SVN] r74253 - in grass/trunk/scripts/r.tileset: . testsuite

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 13 12:51:49 PDT 2019


Author: lucadelu
Date: 2019-03-13 12:51:49 -0700 (Wed, 13 Mar 2019)
New Revision: 74253

Added:
   grass/trunk/scripts/r.tileset/testsuite/
   grass/trunk/scripts/r.tileset/testsuite/test_r_tileset.py
Log:
r.tileset: added test, thanks to Sanjeet Bhatti

Added: grass/trunk/scripts/r.tileset/testsuite/test_r_tileset.py
===================================================================
--- grass/trunk/scripts/r.tileset/testsuite/test_r_tileset.py	                        (rev 0)
+++ grass/trunk/scripts/r.tileset/testsuite/test_r_tileset.py	2019-03-13 19:51:49 UTC (rev 74253)
@@ -0,0 +1,46 @@
+"""
+Created on Sun Jun 08 19:42:32 2018
+
+ at author: Sanjeet Bhatti
+"""
+
+from grass.gunittest.case import TestCase
+from grass.gunittest.main import test
+from grass.gunittest.gmodules import SimpleModule
+
+from grass.script.utils import decode
+
+import os
+
+output = """\
+-78.77462049|35.6875073|-78.60830318|35.74855834|1506|678
+-78.77462049|35.74855834|-78.60830318|35.80960938|1506|678
+""".replace('\n', os.linesep)
+
+
+class TestRTileset(TestCase):
+    """Test r.tileset script"""
+
+    mapName = 'elevation'
+
+    @classmethod
+    def setUpClass(cls):
+        """Use temporary region settings"""
+        cls.use_temp_region()
+        cls.runModule('g.region', raster=cls.mapName, flags='p')
+
+    @classmethod
+    def tearDownClass(cls):
+        """!Remove the temporary region"""
+        cls.del_temp_region()
+
+    def test_tiling(self):
+        """Produce tiling test"""
+        module = SimpleModule('r.tileset', sourceproj='+init=epsg:4326',
+                              maxrows=1024, maxcols=2048)
+        self.assertModule(module)
+
+        self.assertMultiLineEqual(decode(module.outputs.stdout), output)
+
+if __name__ == '__main__':
+    test()


Property changes on: grass/trunk/scripts/r.tileset/testsuite/test_r_tileset.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