Skip to content
Permalink
Browse files

Add initial test suite for processing algorithm dialog

  • Loading branch information
nyalldawson committed Aug 4, 2017
1 parent 34ef954 commit 69a25d0f4381ef8bc7bb5eae11240f2f5b31c941
@@ -85,7 +85,7 @@ def pushConsoleInfo(self, msg):
class AlgorithmDialogBase(BASE, WIDGET):

def __init__(self, alg):
super(AlgorithmDialogBase, self).__init__(iface.mainWindow())
super(AlgorithmDialogBase, self).__init__(iface.mainWindow() if iface else None)
self.setupUi(self)

# don't collapse parameters panel
@@ -6,6 +6,7 @@ PLUGIN_INSTALL(processing tests/testdata ${TEST_DATA_FILES})

IF(ENABLE_TESTS)
INCLUDE(UsePythonTest)
ADD_PYTHON_TEST(ProcessingGuiTest GuiTest.py)
ADD_PYTHON_TEST(ProcessingParametersTest ParametersTest.py)
ADD_PYTHON_TEST(ProcessingModelerTest ModelerTest.py)
ADD_PYTHON_TEST(ProcessingToolsTest ToolsTest.py)
@@ -0,0 +1,45 @@
# -*- coding: utf-8 -*-

"""
***************************************************************************
ParametersTest
---------------------
Date : August 2017
Copyright : (C) 2017 by Nyall Dawson
Email : nyall dot dawson at gmail dot com
***************************************************************************
* *
* 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__ = 'Nyall Dawson'
__date__ = 'August 2017'
__copyright__ = '(C) 2017, Nyall Dawson'

# This will get replaced with a git SHA1 when you do a git archive

__revision__ = '$Format:%H$'

from qgis.testing import start_app, unittest
from qgis.core import QgsApplication

from processing.gui.AlgorithmDialog import AlgorithmDialog

start_app()


class AlgorithmDialogTest(unittest.TestCase):

def testCreation(self):
alg = QgsApplication.processingRegistry().algorithmById('native:centroids')
a = AlgorithmDialog(alg)
self.assertEqual(a.mainWidget().alg, alg)


if __name__ == '__main__':
unittest.main()

0 comments on commit 69a25d0

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