Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Tests QgsProcessingParameterExtent
  • Loading branch information
rldhont authored and nyalldawson committed May 10, 2021
1 parent 8615fec commit 9126290
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion python/plugins/processing/tests/ParametersTest.py
Expand Up @@ -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__':
Expand Down

0 comments on commit 9126290

Please sign in to comment.