Skip to content
Permalink
Browse files
Tests QgsProcessingParameterExtent
  • Loading branch information
rldhont authored and nyalldawson committed May 4, 2021
1 parent 8d232b2 commit 6a3fad81ea10ac78e7bcbba2f1d66c221b49b0ba
Showing with 20 additions and 1 deletion.
  1. +20 −1 python/plugins/processing/tests/ParametersTest.py
@@ -200,7 +200,26 @@ def testParameterCrsDesc(self):
self.assertEqual(param.name(), 'in_bool')
self.assertEqual(param.description(), 'Input CRS')
self.assertIsNone(param.defaultValue())
self.assertTrue(param.flags() & QgsProcessingParameterDefinition.FlagOptional
self.assertTrue(param.flags() & QgsProcessingParameterDefinition.FlagOptional)

def testParameterExtentDesc(self):
desc = 'QgsProcessingParameterExtent|in_extent|Input Extent'
param = getParameterFromString(desc)
self.assertIsNotNone(param)
self.assertEqual(param.type(), 'extent')
self.assertEqual(param.name(), 'in_extent')
self.assertEqual(param.description(), 'Input Extent')
self.assertIsNone(param.defaultValue())
self.assertFalse(param.flags() & QgsProcessingParameterDefinition.FlagOptional)

desc = 'QgsProcessingParameterExtent|in_extent|Input Extent|None|True'
param = getParameterFromString(desc)
self.assertIsNotNone(param)
self.assertEqual(param.type(), 'extent')
self.assertEqual(param.name(), 'in_extent')
self.assertEqual(param.description(), 'Input Extent')
self.assertIsNone(param.defaultValue())
self.assertTrue(param.flags() & QgsProcessingParameterDefinition.FlagOptional)


if __name__ == '__main__':

0 comments on commit 6a3fad8

Please sign in to comment.