Hello,

I am Supreet Singh, from Punjab, India. Currently doing my bachelors from Guru
Nanak Dev Engineering College <https://www.gndec.ac.in/>. I am interested
in GRASS GIS module testing so as an idea for GSOC I sent an email before.
I am Good in HTML, CSS, Javascript, C++ and especially Python as this
project idea is to be written in Python.

Link to a sample image for the project: Google Doc Link
<https://docs.google.com/document/d/1Q-huKI34cJTOuplafcAQCPgYq9hCBBoZNa4SEKAMUno/edit>

I have attached a simple test, I wrote for r.mode.

I am new to Open Source community so I came early, so I can get to know
about OSGeo and GRASS GIS.

Thank You
Supreet
"""
Name:       r.mode test
Purpose:    Tests r.mode and its flags/options.
	
Author:     Supreet Singh
"""

from grass.gunittest.case import TestCase
from grass.gunittest.main import test

class Testrmode(TestCase):
    output='rmode'
    base='facility'
    cover='geology'

    @classmethod
    def setUpClass(cls):
        cls.use_temp_region()

    @classmethod
    def tearDownClass(cls):
        cls.del_temp_region()

    def tearDown(self):
        self.runModule('g.remove', type='raster', flags='f', name=self.output)

    def test_1(self):
        facility='facility'
        self.assertModule('r.mode', base=self.base, cover=self.cover, output=self.output)
        self.assertRasterMinMax(map=facility, refmin=1, refmax=1,
	                        msg="facility in degrees must be between 1 and 1")

    def test_2(self):
        slope='slope'
        self.assertModule('r.mode', base=self.base, cover=self.cover, output=self.output)
        self.assertRasterMinMax(map=slope, refmin=0, refmax=38.68939,
	                        msg="slope in degrees must be between 0 and 38.68939")

    def test_3(self):
        geology='geology'
        self.assertModule('r.mode', base=self.base, cover=self.cover, output=self.output)
        self.assertRasterMinMax(map=geology, refmin=34300, refmax=43600,
	                        msg="geology in degrees must be between 34300 and 43600")

if __name__ == '__main__':
    test()

_______________________________________________
grass-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to