|
30 | 30 |
|
31 | 31 | from actinia_api import URL_PREFIX |
32 | 32 |
|
| 33 | +from actinia_core.version import init_versions, G_VERSION |
| 34 | + |
33 | 35 | from testsuite import ActiniaTestCase, compare_module_to_file |
34 | 36 |
|
35 | 37 |
|
36 | 38 | someGrassModules = ["r.slope.aspect", "importer", "exporter"] |
37 | 39 |
|
38 | 40 |
|
39 | 41 | 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 | + |
40 | 48 | # @unittest.skip("demonstrating skipping") |
41 | 49 | def test_list_modules_get_user(self): |
42 | 50 | """Test HTTP GET /grass_modules for user""" |
@@ -139,7 +147,10 @@ def test_filter_list_modules_get_admin_3(self): |
139 | 147 | assert hasattr(resp, "json") |
140 | 148 | # WARNING: this depends on existing GRASS GIS modules and possible |
141 | 149 | # 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 |
143 | 154 | assert resp.json["processes"][0]["categories"] != 0 |
144 | 155 | assert hasattr(resp.json["processes"][0], "parameters") is False |
145 | 156 |
|
|
0 commit comments