Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Register meta type for geometry processing parameter
Fix QgsProcessingParameterGeometry argument list
- Loading branch information
1 parent
aa0a8ab
commit 6262965
Showing
6 changed files
with
79 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# -*- coding: utf-8 -*- | ||
"""QGIS Unit tests for Processing algorithm runner(s). | ||
.. note:: This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 2 of the License, or | ||
(at your option) any later version. | ||
""" | ||
__author__ = 'David Marteau' | ||
__date__ = '2020-09' | ||
__copyright__ = 'Copyright 2020, The QGIS Project' | ||
|
||
import re | ||
from qgis.PyQt.QtCore import QCoreApplication | ||
from qgis.testing import start_app, unittest | ||
from qgis.core import QgsProcessingAlgRunnerTask | ||
|
||
from processing.core.Processing import Processing | ||
from processing.core.ProcessingConfig import ProcessingConfig | ||
from qgis.testing import start_app, unittest | ||
from qgis.core import ( | ||
QgsApplication, | ||
QgsSettings, | ||
QgsProcessingContext, | ||
QgsProcessingAlgRunnerTask, | ||
QgsProcessingAlgorithm, | ||
QgsProject, | ||
QgsProcessingFeedback, | ||
QgsProcessingParameterGeometry, | ||
QgsWkbTypes, | ||
) | ||
|
||
start_app() | ||
|
||
|
||
|
||
class TestQgsProcessingParameters(unittest.TestCase): | ||
|
||
@classmethod | ||
def setUpClass(cls): | ||
"""Run before all tests""" | ||
QCoreApplication.setOrganizationName("QGIS_Test") | ||
QCoreApplication.setOrganizationDomain( | ||
"QGIS_TestPyQgsProcessingParameters.com") | ||
QCoreApplication.setApplicationName("QGIS_TestPyQgsProcessingParameters") | ||
QgsSettings().clear() | ||
Processing.initialize() | ||
cls.registry = QgsApplication.instance().processingRegistry() | ||
|
||
def test_qgsprocessinggometry(self): # spellok | ||
""" Test QgsProcessingParameterGeometry initialisation | ||
""" | ||
geomtypes = [QgsWkbTypes.PointGeometry, QgsWkbTypes.PolygonGeometry] | ||
param = QgsProcessingParameterGeometry( name='test', geometryTypes=geomtypes) | ||
|
||
types = param.geometryTypes() | ||
|
||
self.assertEqual( param.geometryTypes(), geomtypes) | ||
|
||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |