[GRASS-SVN] r74247 - in grass/trunk/scripts/r.mask: . testsuite

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Mar 13 11:45:17 PDT 2019


Author: lucadelu
Date: 2019-03-13 11:45:16 -0700 (Wed, 13 Mar 2019)
New Revision: 74247

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

Added: grass/trunk/scripts/r.mask/testsuite/test_r_mask.py
===================================================================
--- grass/trunk/scripts/r.mask/testsuite/test_r_mask.py	                        (rev 0)
+++ grass/trunk/scripts/r.mask/testsuite/test_r_mask.py	2019-03-13 18:45:16 UTC (rev 74247)
@@ -0,0 +1,42 @@
+"""
+Created on Sun Jun 07 22:19:41 2018
+
+ at author: Sanjeet Bhatti
+"""
+
+from grass.gunittest.case import TestCase
+from grass.gunittest.main import test
+from grass.gunittest.gmodules import SimpleModule
+
+
+class TestRMask(TestCase):
+    """Test r.mask script"""
+
+    mapName = 'lakes'
+    mapNameOther = 'elevation'
+    values = 'min=56.8785\nmax=134.87'
+
+    @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. Remove mask"""
+        cls.del_temp_region()
+
+        cls.runModule('r.mask', flags='r')
+
+    def test_mask(self):
+        """Mask test"""
+        module = SimpleModule('r.mask', raster=self.mapName)
+        self.assertModule(module)
+
+        self.assertRasterFitsUnivar(raster=self.mapNameOther,
+                                    reference=self.values,
+                                    precision=5)
+
+if __name__ == '__main__':
+    test()


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