Skip to content

Commit bfe23e1

Browse files
committed
fix tests for newest GRASS GIS
1 parent 712a0b0 commit bfe23e1

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

tests/test_modules_grass.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,21 @@
3030

3131
from actinia_api import URL_PREFIX
3232

33+
from actinia_core.version import init_versions, G_VERSION
34+
3335
from testsuite import ActiniaTestCase, compare_module_to_file
3436

3537

3638
someGrassModules = ["r.slope.aspect", "importer", "exporter"]
3739

3840

3941
class GmodulesTest(ActiniaTestCase):
42+
43+
# For expected test results, which are dependent on GRASS GIS version
44+
init_versions()
45+
grass_version_s = G_VERSION["version"]
46+
grass_version = [int(item) for item in grass_version_s.split(".")[:2]]
47+
4048
# @unittest.skip("demonstrating skipping")
4149
def test_list_modules_get_user(self):
4250
"""Test HTTP GET /grass_modules for user"""
@@ -139,7 +147,10 @@ def test_filter_list_modules_get_admin_3(self):
139147
assert hasattr(resp, "json")
140148
# WARNING: this depends on existing GRASS GIS modules and possible
141149
# installed GRASS GIS Addons
142-
assert len(resp.json["processes"]) == 2
150+
if self.grass_version < [8, 5]:
151+
assert len(resp.json["processes"]) == 2
152+
else:
153+
assert len(resp.json["processes"]) == 3
143154
assert resp.json["processes"][0]["categories"] != 0
144155
assert hasattr(resp.json["processes"][0], "parameters") is False
145156

0 commit comments

Comments
 (0)