Skip to content
Permalink
Browse files

[Processing][Test] QgsProcessingParameterFolderDestination descriptio…

…n string
  • Loading branch information
rldhont committed May 4, 2021
1 parent 59ab80b commit a30f5fe2d49d13cedbba7d142ca2370226c9c4e5
Showing with 32 additions and 0 deletions.
  1. +32 −0 python/plugins/processing/tests/ParametersTest.py
@@ -397,6 +397,38 @@ def testParameterRasterDestDesc(self):
self.assertEqual(param.description(), 'Raster Destination')
self.assertIsNone(param.defaultValue())
self.assertFalse(param.flags() & QgsProcessingParameterDefinition.FlagOptional)
self.assertTrue(param.createByDefault())

desc = 'QgsProcessingParameterRasterDestination|param_raster_dest|Raster Destination|None|True|False'
param = getParameterFromString(desc)
self.assertIsNotNone(param)
self.assertEqual(param.type(), 'rasterDestination')
self.assertEqual(param.name(), 'param_raster_dest')
self.assertEqual(param.description(), 'Raster Destination')
self.assertIsNone(param.defaultValue())
self.assertTrue(param.flags() & QgsProcessingParameterDefinition.FlagOptional)
self.assertFalse(param.createByDefault())

def testParameterFolderDestDesc(self):
desc = 'QgsProcessingParameterFolderDestination|param_folder_dest|Folder Destination'
param = getParameterFromString(desc)
self.assertIsNotNone(param)
self.assertEqual(param.type(), 'folderDestination')
self.assertEqual(param.name(), 'param_folder_dest')
self.assertEqual(param.description(), 'Folder Destination')
self.assertIsNone(param.defaultValue())
self.assertFalse(param.flags() & QgsProcessingParameterDefinition.FlagOptional)
self.assertTrue(param.createByDefault())

desc = 'QgsProcessingParameterFolderDestination|param_folder_dest|Folder Destination|None|True|False'
param = getParameterFromString(desc)
self.assertIsNotNone(param)
self.assertEqual(param.type(), 'folderDestination')
self.assertEqual(param.name(), 'param_folder_dest')
self.assertEqual(param.description(), 'Folder Destination')
self.assertIsNone(param.defaultValue())
self.assertTrue(param.flags() & QgsProcessingParameterDefinition.FlagOptional)
self.assertFalse(param.createByDefault())


if __name__ == '__main__':

0 comments on commit a30f5fe

Please sign in to comment.