Skip to content
Permalink
Browse files

Allow processing tests to specify ellipsoid/project CRS

  • Loading branch information
nyalldawson committed Jun 28, 2018
1 parent 1223a1c commit 9fe26af8fa17a10cfcd652ec9a8db22a19bd94a1
Showing with 11 additions and 0 deletions.
  1. +11 −0 python/plugins/processing/tests/AlgorithmsTestBase.py
@@ -43,6 +43,7 @@

from qgis.core import (QgsVectorLayer,
QgsRasterLayer,
QgsCoordinateReferenceSystem,
QgsFeatureRequest,
QgsMapLayer,
QgsProject,
@@ -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']))

0 comments on commit 9fe26af

Please sign in to comment.
You can’t perform that action at this time.