[GRASS-SVN] r74244 - in grass/trunk/scripts/r.blend: . testsuite

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 13 11:39:02 PDT 2019


Author: lucadelu
Date: 2019-03-13 11:39:02 -0700 (Wed, 13 Mar 2019)
New Revision: 74244

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

Added: grass/trunk/scripts/r.blend/testsuite/test_r_blend.py
===================================================================
--- grass/trunk/scripts/r.blend/testsuite/test_r_blend.py	                        (rev 0)
+++ grass/trunk/scripts/r.blend/testsuite/test_r_blend.py	2019-03-13 18:39:02 UTC (rev 74244)
@@ -0,0 +1,47 @@
+"""
+Created on Sun Jun 07 21:42:39 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.core import run_command
+
+
+class TestRBlend(TestCase):
+    """Test r.blend script"""
+
+    map1 = 'aspect'
+    map2 = 'elevation'
+    temp1 = 'elev_shade_blend.r'
+    temp2 = 'elev_shade_blend.g'
+    temp3 = 'elev_shade_blend.b'
+
+    @classmethod
+    def setUpClass(cls):
+        """Create maps in a small region."""
+        cls.use_temp_region()
+        cls.runModule('g.region', raster=cls.map1, flags='p')
+        run_command('d.mon', start='wx0')
+
+    @classmethod
+    def tearDownClass(cls):
+        """Remove temporary region"""
+        cls.runModule('g.remove', flags='f', type='raster',
+                      name=(cls.temp1, cls.temp2, cls.temp3))
+        cls.del_temp_region()
+        run_command('d.mon', stop='wx0')
+
+    def test_blend(self):
+        """blends color test"""
+        module = SimpleModule('r.blend', first=self.map1, second=self.map2,
+                              output='elev_shade_blend')
+        self.assertModule(module)
+
+        run_command('d.rgb', red=self.temp1, green=self.temp2,
+                    blue=self.temp3)
+
+if __name__ == '__main__':
+    test()


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