Skip to content

Commit

Permalink
Allow processing tests to specify ellipsoid/project CRS
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Jun 28, 2018
1 parent 1223a1c commit 9fe26af
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions python/plugins/processing/tests/AlgorithmsTestBase.py
Expand Up @@ -43,6 +43,7 @@

from qgis.core import (QgsVectorLayer,
QgsRasterLayer,
QgsCoordinateReferenceSystem,
QgsFeatureRequest,
QgsMapLayer,
QgsProject,
Expand Down Expand Up @@ -86,6 +87,16 @@ def check_algorithm(self, name, defs):
self.vector_layer_params = {}
QgsProject.instance().removeAllMapLayers()

if 'project_crs' in defs:
QgsProject.instance().setCrs(QgsCoordinateReferenceSystem(defs['project_crs']))
else:
QgsProject.instance().setCrs(QgsCoordinateReferenceSystem())

if 'ellipsoid' in defs:
QgsProject.instance().setEllipsoid(defs['ellipsoid'])
else:
QgsProject.instance().setEllipsoid('')

params = self.load_params(defs['params'])

print('Running alg: "{}"'.format(defs['algorithm']))
Expand Down

0 comments on commit 9fe26af

Please sign in to comment.