[GRASS-SVN] r74251 - in grass/trunk/scripts/r.rgb: . testsuite

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 13 12:47:24 PDT 2019


Author: lucadelu
Date: 2019-03-13 12:47:24 -0700 (Wed, 13 Mar 2019)
New Revision: 74251

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

Added: grass/trunk/scripts/r.rgb/testsuite/test_r_rgb.py
===================================================================
--- grass/trunk/scripts/r.rgb/testsuite/test_r_rgb.py	                        (rev 0)
+++ grass/trunk/scripts/r.rgb/testsuite/test_r_rgb.py	2019-03-13 19:47:24 UTC (rev 74251)
@@ -0,0 +1,44 @@
+"""
+Created on Sun Jun 08 13:20:31 2018
+
+ at author: Sanjeet Bhatti
+"""
+
+from grass.gunittest.case import TestCase
+from grass.gunittest.main import test
+from grass.gunittest.gmodules import SimpleModule
+
+
+class TestRRGB(TestCase):
+    """Test r.rgb script"""
+
+    mapName = 'elevation'
+    red = 'elevation.r'
+    green = 'elevation.g'
+    blue = 'elevation.b'
+
+    @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.red, cls.green, cls.blue))
+        cls.del_temp_region()
+
+    def test_rgb_maps(self):
+        """Generates rgb maps from a raster map test"""
+        module = SimpleModule('r.rgb', input=self.mapName, red=self.red,
+                              green=self.green, blue=self.blue)
+        self.assertModule(module)
+
+        self.assertRasterExists(self.red)
+        self.assertRasterExists(self.green)
+        self.assertRasterExists(self.blue)
+
+if __name__ == '__main__':
+    test()


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