[GRASS-SVN] r74252 - in grass/trunk/scripts/r.shade: . testsuite

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 13 12:48:52 PDT 2019


Author: lucadelu
Date: 2019-03-13 12:48:52 -0700 (Wed, 13 Mar 2019)
New Revision: 74252

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

Added: grass/trunk/scripts/r.shade/testsuite/test_r_shade.py
===================================================================
--- grass/trunk/scripts/r.shade/testsuite/test_r_shade.py	                        (rev 0)
+++ grass/trunk/scripts/r.shade/testsuite/test_r_shade.py	2019-03-13 19:48:52 UTC (rev 74252)
@@ -0,0 +1,41 @@
+"""
+Created on Sun Jun 08 13:44:07 2018
+
+ at author: Sanjeet Bhatti
+"""
+
+from grass.gunittest.case import TestCase
+from grass.gunittest.main import test
+from grass.gunittest.gmodules import SimpleModule
+
+
+class TestRShade(TestCase):
+    """Test r.shade script"""
+
+    mapName = 'aspect'
+    color = 'elevation'
+    outputMap = 'elevation_aspect_shaded'
+
+    @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.runModule('g.remove', flags='f', type='raster',
+                      name=cls.outputMap)
+        cls.del_temp_region()
+
+    def test_shade_map(self):
+        """Generates a color raster map over shaded relief map test"""
+        module = SimpleModule('r.shade', shade=self.mapName, color=self.color,
+                              output=self.outputMap)
+        self.assertModule(module)
+
+        self.assertRasterExists(self.outputMap)
+
+if __name__ == '__main__':
+    test()


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