Skip to content

Commit

Permalink
r.univar: add parallel test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronsms committed Jun 11, 2021
1 parent 9ce1b56 commit 61519c2
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions raster/r.univar/testsuite/test_r_univar.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ def test_1(self):
self.assertRasterFitsUnivar(
raster="map_a", reference=univar_string, precision=3
)
self.assertModuleKeyValue(
module="r.univar",
map="map_a",
flags="g",
nprocs=4,
reference=univar_string,
precision=3,
sep="=",
)

def test_2(self):
# Output of r.univar
Expand All @@ -66,6 +75,15 @@ def test_2(self):
self.assertRasterFitsUnivar(
raster="map_a", reference=univar_string, precision=3
)
self.assertModuleKeyValue(
module="r.univar",
map="map_a",
flags="g",
nprocs=4,
reference=univar_string,
precision=3,
sep="=",
)

def test_3(self):
"""
Expand All @@ -92,6 +110,15 @@ def test_3(self):
precision=3,
sep="=",
)
self.assertModuleKeyValue(
module="r.univar",
map="map_a",
flags="rg",
nprocs=4,
reference=univar_string,
precision=3,
sep="=",
)

def test_multiple_1(self):
# Output of r.univar
Expand All @@ -113,6 +140,15 @@ def test_multiple_1(self):
precision=3,
sep="=",
)
self.assertModuleKeyValue(
module="r.univar",
map=["map_a", "map_b"],
flags="rg",
nprocs=4,
reference=univar_string,
precision=3,
sep="=",
)

def test_multiple_2(self):
# Output of r.univar
Expand All @@ -135,6 +171,15 @@ def test_multiple_2(self):
precision=3,
sep="=",
)
self.assertModuleKeyValue(
module="r.univar",
map=["map_a", "map_b"],
flags="g",
nprocs=4,
reference=univar_string,
precision=3,
sep="=",
)

def test_multiple_3(self):
"""
Expand Down Expand Up @@ -162,6 +207,15 @@ def test_multiple_3(self):
precision=3,
sep="=",
)
self.assertModuleKeyValue(
module="r.univar",
map=["map_a", "map_b"],
flags="rg",
nprocs=4,
reference=univar_string,
precision=3,
sep="=",
)

def test_1_zone(self):
"""
Expand Down Expand Up @@ -201,6 +255,16 @@ def test_1_zone(self):
precision=3,
sep="=",
)
self.assertModuleKeyValue(
module="r.univar",
map=["map_a"],
zones="zone_map",
flags="g",
nprocs=4,
reference=univar_string,
precision=3,
sep="=",
)


class TestAccumulateFails(TestCase):
Expand Down

0 comments on commit 61519c2

Please sign in to comment.