소스 검색

r.shade: added test, thanks to Sanjeet Bhatti

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@74252 15284696-431f-4ddb-bdfa-cd5b030d7da7
Luca Delucchi 6 년 전
부모
커밋
d69b4bd854
1개의 변경된 파일41개의 추가작업 그리고 0개의 파일을 삭제
  1. 41 0
      scripts/r.shade/testsuite/test_r_shade.py

+ 41 - 0
scripts/r.shade/testsuite/test_r_shade.py

@@ -0,0 +1,41 @@
+"""
+Created on Sun Jun 08 13:44:07 2018
+
+@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()