diff --git a/python/plugins/processing/tests/AlgorithmsTestBase.py b/python/plugins/processing/tests/AlgorithmsTestBase.py index 3323c5477ac8..72777cc93fa0 100644 --- a/python/plugins/processing/tests/AlgorithmsTestBase.py +++ b/python/plugins/processing/tests/AlgorithmsTestBase.py @@ -41,6 +41,7 @@ QgsCoordinateReferenceSystem, QgsFeatureRequest, QgsMapLayer, + QgsMeshLayer, QgsProject, QgsApplication, QgsProcessingContext, @@ -145,6 +146,9 @@ def check_algorithm(self, name, defs): print('Running alg: "{}"'.format(defs['algorithm'])) alg = QgsApplication.processingRegistry().createAlgorithmById(defs['algorithm']) + if alg is None: + print('Algorithm not found: {}'.format(defs['algorithm'])) + return parameters = {} if isinstance(params, list): @@ -217,7 +221,7 @@ def load_param(self, param, id=None): parameter based on its key `type` and return the appropriate parameter to pass to the algorithm. """ try: - if param['type'] in ('vector', 'raster', 'table'): + if param['type'] in ('vector', 'raster', 'table', 'mesh'): return self.load_layer(id, param).id() elif param['type'] == 'vrtlayers': vals = [] @@ -320,6 +324,8 @@ def load_layer(self, id, param): options = QgsRasterLayer.LayerOptions() options.loadDefaultStyle = False lyr = QgsRasterLayer(filepath, param['name'], 'gdal', options) + elif param['type'] == 'mesh': + lyr = QgsMeshLayer(filepath, param['name'], "mdal") self.assertTrue(lyr.isValid(), f'Could not load layer "{filepath}" from param {param}') QgsProject.instance().addMapLayer(lyr)