Skip to content

Commit

Permalink
first try of r.stats #10
Browse files Browse the repository at this point in the history
testing r.stats #10

Co-Authored-By: josefpudil <[email protected]>
  • Loading branch information
dekanluc and JosefPudil committed May 30, 2020
1 parent 4e05bc7 commit 436894f
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions raster/r.stats/test_suite/test_r_stats.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env python3

from grass.gunittest.case import TestCase
from grass.gunittest.main import test
import grass.script as gscript

output = 'test1'
stats = 'lakes'
data = [['34300=44200.000000'],
['39000=3509900.000000'],
['43600=47000.000000']]


class Test_r_stats(TestCase):
@classmethod
def setUpClass(cls):
cls.use_temp_region()
cls.runModule('g.region', raster = stats)


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

# testing total area
def test_check_area(self):
#self.assertModule('r.stats', input = stats , flags = 'aN')
module = self.assertModule('r.stats', input = stats , flags = 'aN',separator = '=')
print(self.assertModule('r.stats', input = stats , flags = 'aN',separator = '='))
#self.assertModuleKeyValue(module,
# reference=dict('34300'='44200' , '39000'='3509900' , '43600'='47000'),
# precision=1, sep='=')
self.assertEqual(data,module)
if __name__ == '__main__':
test()
Expand Down

0 comments on commit 436894f

Please sign in to comment.