Skip to content
Permalink
Browse files

ParameterMultipleInput: added tests.

  • Loading branch information
sept-en committed Mar 22, 2016
1 parent d5acc21 commit 4b75f4e0e3458cfd21085f393404e09a967f9de0
Showing with 13 additions and 0 deletions.
  1. +13 −0 python/plugins/processing/tests/ParametersTest.py
@@ -298,6 +298,19 @@ def testOptional(self):
self.assertFalse(parameter.setValue(None))
self.assertEqual(parameter.value, "myLayerFile.shp")

def testMultipleInput(self):
parameter = ParameterMultipleInput('myName', 'myDesc', optional=True)
parameter.assertTrue(parameter.setMinNumInputs(1))

parameter = ParameterMultipleInput ('myName', 'myDesc', optional=False)
parameter.assertFalse(parameter.setMinNumInputs(0))

parameter.setMinNumInputs(2)
parameter.assertTrue(parameter.setValue(['myLayerFile.shp', 'myLayerFile2.shp']))

parameter.setMinNumInputs(3)
parameter.assertFalse(parameter.setValue(['myLayerFile.shp', 'myLayerFile2.shp']))

def testGetAsStringWhenRaster(self):
parameter = ParameterMultipleInput('myName', 'myDesc', datatype=ParameterMultipleInput.TYPE_RASTER)

0 comments on commit 4b75f4e

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