From 7649903889d449b365f9a127c0558cfc11220770 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Sat, 28 Nov 2015 21:11:28 -0600 Subject: [PATCH 1/4] Processing Tests: Fix ParameterExtent test which was written for required Parameter --- tests/src/python/plugins/processing/ParametersTest.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/src/python/plugins/processing/ParametersTest.py b/tests/src/python/plugins/processing/ParametersTest.py index ff597da106f0..3bb68dc7b50e 100644 --- a/tests/src/python/plugins/processing/ParametersTest.py +++ b/tests/src/python/plugins/processing/ParametersTest.py @@ -61,10 +61,15 @@ def testParameterExtent(self): assert not param.setValue('0,2,0') assert not param.setValue('0,2,0,a') assert param.setValue('0,2,2,4') - assert param.value == '0,2,2,4' + self.assertEqual(param.value, '0,2,2,4') assert param.setValue(None) - assert param.value == param.default, 'Result: {}, Expected: {}'.format(param.value, param.default) + self.assertEqual(param.value, None) + required = ParameterExtent('name', 'desc', optional=False) + first_value = '0,2,2,4' + assert required.setValue(first_value) + assert not required.setValue(None) + self.assertEqual(required.value, first_value) def suite(): suite = unittest.makeSuite(ParametersTest, 'test') From 00ed6942bbf12994c9b3ec1e86785a3a046d123d Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Sat, 28 Nov 2015 21:41:58 -0600 Subject: [PATCH 2/4] Processing Tests remove unused imports from Parameters Test --- tests/src/python/plugins/processing/ParametersTest.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/src/python/plugins/processing/ParametersTest.py b/tests/src/python/plugins/processing/ParametersTest.py index 3bb68dc7b50e..2084d973cd22 100644 --- a/tests/src/python/plugins/processing/ParametersTest.py +++ b/tests/src/python/plugins/processing/ParametersTest.py @@ -25,11 +25,7 @@ __revision__ = '$Format:%H$' -from utilities import getQgisTestApp, unittest - -QGISAPP, CANVAS, IFACE, PARENT = getQgisTestApp() - -from plugins.processing.core import parameters +from utilities import unittest from plugins.processing.core.parameters import ParameterNumber from plugins.processing.core.parameters import ParameterCrs From 0fa57ddbb8681f7a0e0bbfc4add046f11422b389 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Sat, 28 Nov 2015 21:57:00 -0600 Subject: [PATCH 3/4] tests no longer live in processing module, method isn't used anywhere in codebase --- python/plugins/processing/__init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/python/plugins/processing/__init__.py b/python/plugins/processing/__init__.py index 5f7045df49d8..8d48cfb07431 100644 --- a/python/plugins/processing/__init__.py +++ b/python/plugins/processing/__init__.py @@ -30,8 +30,6 @@ from processing.tools.vector import * from processing.tools.raster import * from processing.tools.system import * -from processing.tests.TestData import loadTestData - def classFactory(iface): from processing.ProcessingPlugin import ProcessingPlugin From 2b7e3d6cc56c98b739937ea0f5357df24d04c77d Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Sat, 28 Nov 2015 22:09:42 -0600 Subject: [PATCH 4/4] make plugins a module Without this we can't include python plugins as modules without path mangling. --- python/plugins/__init__.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 python/plugins/__init__.py diff --git a/python/plugins/__init__.py b/python/plugins/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1