Hi,
I attached the fixed file.
Thank You
Supreet Singh
https://singhsupreet.github.io/
On Wed, Mar 21, 2018 at 9:17 PM, Luca Delucchi <[email protected]> wrote:
> On 31 January 2018 at 15:31, sharry gill <[email protected]> wrote:
> > Hello,
> >
>
> Hi Sharry
>
> >
> > I have attached a simple test, I wrote for r.mode.
> >
>
> I run it in nc_basic_spm_grass7 [0] but it fails
>
> GRASS 7.5.svn (nc_basic_spm_grass7):~ > python ~/testrmode.py
>
> ERROR: Raster map <facility> not found
> ERROR: Raster map <facility> not found
>
> E
> ERROR: Raster map <facility> not found
> ERROR: Raster map <facility> not found
>
> E
> ERROR: Raster map <facility> not found
> ERROR: Raster map <facility> not found
>
> F
> ======================================================================
> ERROR: test_1 (__main__.Testrmode)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/home/lucadelu/testrmode.py", line 31, in test_1
> msg="facility in degrees must be between 1 and 1")
> File "/home/lucadelu/compilati/grass_trunk/dist.x86_64-pc-
> linux-gnu/etc/python/grass/gunittest/case.py",
> line 461, in assertRasterMinMax
> stdout = call_module('r.info', map=map, flags='r')
> File "/home/lucadelu/compilati/grass_trunk/dist.x86_64-pc-
> linux-gnu/etc/python/grass/gunittest/gmodules.py",
> line 131, in call_module
> raise CalledModuleError(returncode, module, kwargs, errors)
> CalledModuleError: Module run 1 r.info ended with error
> Process ended with non-zero return code {'map': 'facility', 'flags':
> 'r', 'stderr': -1, 'stdout': -1}. See the following errors:
> ERROR: Raster map <facility> not found
>
>
> ======================================================================
> ERROR: test_2 (__main__.Testrmode)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/home/lucadelu/testrmode.py", line 37, in test_2
> msg="slope in degrees must be between 0 and 38.68939")
> File "/home/lucadelu/compilati/grass_trunk/dist.x86_64-pc-
> linux-gnu/etc/python/grass/gunittest/case.py",
> line 461, in assertRasterMinMax
> stdout = call_module('r.info', map=map, flags='r')
> File "/home/lucadelu/compilati/grass_trunk/dist.x86_64-pc-
> linux-gnu/etc/python/grass/gunittest/gmodules.py",
> line 131, in call_module
> raise CalledModuleError(returncode, module, kwargs, errors)
> CalledModuleError: Module run 1 r.info ended with error
> Process ended with non-zero return code {'map': 'slope', 'flags': 'r',
> 'stderr': -1, 'stdout': -1}. See the following errors:
> ERROR: Raster map <slope> not found
>
>
> ======================================================================
> FAIL: test_3 (__main__.Testrmode)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/home/lucadelu/testrmode.py", line 43, in test_3
> msg="geology in degrees must be between 34300 and 43600")
> File "/home/lucadelu/compilati/grass_trunk/dist.x86_64-pc-
> linux-gnu/etc/python/grass/gunittest/case.py",
> line 468, in assertRasterMinMax
> self.fail(self._formatMessage(msg, stdmsg))
> AssertionError: geology in degrees must be between 34300 and 43600
> The actual minimum (217) is smaller than the reference one (34300) for
> raster map geology (with maximum 948)
>
> ----------------------------------------------------------------------
> Ran 3 tests in 0.905s
> FAILED (failures=1, errors=2)
>
> could you please fix it?
>
> > 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
> >
>
> [0] https://grass.osgeo.org/sampledata/north_carolina/nc_
> basic_spm_grass7.tar.gz
>
> --
> ciao
> Luca
>
> www.lucadelu.org
>
"""
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='soils_Kfactor'
@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):
elevation='elevation'
self.assertModule('r.mode', base=self.base, cover=self.cover, output=self.output)
self.assertRasterMinMax(map=elevation, refmin=55.57879, refmax=156.3299,
msg="geology in degrees must be between 55.57879 and 156.3299")
if __name__ == '__main__':
test()
_______________________________________________
grass-dev mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/grass-dev