Skip to content

Commit

Permalink
[Processing][Test] QgsProcessingParameterVectorLayer description stri…
Browse files Browse the repository at this point in the history
…ng - Deactivated tests

QgsProcessingParameterVectorLayer multi data types does not work as QgsProcessingParameterFeatureSource
  • Loading branch information
rldhont authored and nyalldawson committed May 6, 2021
1 parent cde42b8 commit bb5871c
Showing 1 changed file with 55 additions and 45 deletions.
100 changes: 55 additions & 45 deletions python/plugins/processing/tests/ParametersTest.py
Expand Up @@ -619,15 +619,17 @@ def testParameterVectorLayerDesc(self):
self.assertIsNone(param.defaultValue())
self.assertFalse(param.flags() & QgsProcessingParameterDefinition.FlagOptional)

desc = 'QgsProcessingParameterVectorLayer|in_vector|Input Vector|QgsProcessing.TypeVectorPoint'
param = getParameterFromString(desc)
self.assertIsNotNone(param)
self.assertEqual(param.type(), 'vector')
self.assertEqual(param.name(), 'in_vector')
self.assertEqual(param.description(), 'Input Vector')
self.assertListEqual(param.dataTypes(), [QgsProcessing.TypeVectorPoint])
self.assertIsNone(param.defaultValue())
self.assertFalse(param.flags() & QgsProcessingParameterDefinition.FlagOptional)
# QgsProcessingParameterVectorLayer multi data types does not work
# as QgsProcessingParameterFeatureSource
# desc = 'QgsProcessingParameterVectorLayer|in_vector|Input Vector|QgsProcessing.TypeVectorPoint'
# param = getParameterFromString(desc)
# self.assertIsNotNone(param)
# self.assertEqual(param.type(), 'vector')
# self.assertEqual(param.name(), 'in_vector')
# self.assertEqual(param.description(), 'Input Vector')
# self.assertListEqual(param.dataTypes(), [QgsProcessing.TypeVectorPoint])
# self.assertIsNone(param.defaultValue())
# self.assertFalse(param.flags() & QgsProcessingParameterDefinition.FlagOptional)

desc = 'QgsProcessingParameterVectorLayer|in_vector|Input Vector|1'
param = getParameterFromString(desc)
Expand All @@ -639,15 +641,17 @@ def testParameterVectorLayerDesc(self):
self.assertIsNone(param.defaultValue())
self.assertFalse(param.flags() & QgsProcessingParameterDefinition.FlagOptional)

desc = 'QgsProcessingParameterVectorLayer|in_vector|Input Vector|QgsProcessing.TypeVectorLine'
param = getParameterFromString(desc)
self.assertIsNotNone(param)
self.assertEqual(param.type(), 'vector')
self.assertEqual(param.name(), 'in_vector')
self.assertEqual(param.description(), 'Input Vector')
self.assertListEqual(param.dataTypes(), [QgsProcessing.TypeVectorLine])
self.assertIsNone(param.defaultValue())
self.assertFalse(param.flags() & QgsProcessingParameterDefinition.FlagOptional)
# QgsProcessingParameterVectorLayer multi data types does not work
# as QgsProcessingParameterFeatureSource
# desc = 'QgsProcessingParameterVectorLayer|in_vector|Input Vector|QgsProcessing.TypeVectorLine'
# param = getParameterFromString(desc)
# self.assertIsNotNone(param)
# self.assertEqual(param.type(), 'vector')
# self.assertEqual(param.name(), 'in_vector')
# self.assertEqual(param.description(), 'Input Vector')
# self.assertListEqual(param.dataTypes(), [QgsProcessing.TypeVectorLine])
# self.assertIsNone(param.defaultValue())
# self.assertFalse(param.flags() & QgsProcessingParameterDefinition.FlagOptional)

desc = 'QgsProcessingParameterVectorLayer|in_vector|Input Vector|2'
param = getParameterFromString(desc)
Expand All @@ -659,15 +663,17 @@ def testParameterVectorLayerDesc(self):
self.assertIsNone(param.defaultValue())
self.assertFalse(param.flags() & QgsProcessingParameterDefinition.FlagOptional)

desc = 'QgsProcessingParameterVectorLayer|in_vector|Input Vector|QgsProcessing.TypeVectorPolygon'
param = getParameterFromString(desc)
self.assertIsNotNone(param)
self.assertEqual(param.type(), 'vector')
self.assertEqual(param.name(), 'in_vector')
self.assertEqual(param.description(), 'Input Vector')
self.assertListEqual(param.dataTypes(), [QgsProcessing.TypeVectorPolygon])
self.assertIsNone(param.defaultValue())
self.assertFalse(param.flags() & QgsProcessingParameterDefinition.FlagOptional)
# QgsProcessingParameterVectorLayer multi data types does not work
# as QgsProcessingParameterFeatureSource
# desc = 'QgsProcessingParameterVectorLayer|in_vector|Input Vector|QgsProcessing.TypeVectorPolygon'
# param = getParameterFromString(desc)
# self.assertIsNotNone(param)
# self.assertEqual(param.type(), 'vector')
# self.assertEqual(param.name(), 'in_vector')
# self.assertEqual(param.description(), 'Input Vector')
# self.assertListEqual(param.dataTypes(), [QgsProcessing.TypeVectorPolygon])
# self.assertIsNone(param.defaultValue())
# self.assertFalse(param.flags() & QgsProcessingParameterDefinition.FlagOptional)

desc = 'QgsProcessingParameterVectorLayer|in_vector|Input Vector|5'
param = getParameterFromString(desc)
Expand All @@ -679,15 +685,17 @@ def testParameterVectorLayerDesc(self):
self.assertIsNone(param.defaultValue())
self.assertFalse(param.flags() & QgsProcessingParameterDefinition.FlagOptional)

desc = 'QgsProcessingParameterVectorLayer|in_vector|Input Vector|QgsProcessing.TypeVector'
param = getParameterFromString(desc)
self.assertIsNotNone(param)
self.assertEqual(param.type(), 'vector')
self.assertEqual(param.name(), 'in_vector')
self.assertEqual(param.description(), 'Input Vector')
self.assertListEqual(param.dataTypes(), [QgsProcessing.TypeVector])
self.assertIsNone(param.defaultValue())
self.assertFalse(param.flags() & QgsProcessingParameterDefinition.FlagOptional)
# QgsProcessingParameterVectorLayer multi data types does not work
# as QgsProcessingParameterFeatureSource
# desc = 'QgsProcessingParameterVectorLayer|in_vector|Input Vector|QgsProcessing.TypeVector'
# param = getParameterFromString(desc)
# self.assertIsNotNone(param)
# self.assertEqual(param.type(), 'vector')
# self.assertEqual(param.name(), 'in_vector')
# self.assertEqual(param.description(), 'Input Vector')
# self.assertListEqual(param.dataTypes(), [QgsProcessing.TypeVector])
# self.assertIsNone(param.defaultValue())
# self.assertFalse(param.flags() & QgsProcessingParameterDefinition.FlagOptional)

desc = 'QgsProcessingParameterVectorLayer|in_vector|Input Vector|1;2'
param = getParameterFromString(desc)
Expand All @@ -699,15 +707,17 @@ def testParameterVectorLayerDesc(self):
self.assertIsNone(param.defaultValue())
self.assertFalse(param.flags() & QgsProcessingParameterDefinition.FlagOptional)

desc = 'QgsProcessingParameterVectorLayer|in_vector|Input Vector|QgsProcessing.TypeVectorLine;QgsProcessing.TypeVectorPolygon'
param = getParameterFromString(desc)
self.assertIsNotNone(param)
self.assertEqual(param.type(), 'vector')
self.assertEqual(param.name(), 'in_vector')
self.assertEqual(param.description(), 'Input Vector')
self.assertListEqual(param.dataTypes(), [QgsProcessing.TypeVectorLine, QgsProcessing.TypeVectorPolygon])
self.assertIsNone(param.defaultValue())
self.assertFalse(param.flags() & QgsProcessingParameterDefinition.FlagOptional)
# QgsProcessingParameterVectorLayer multi data types does not work
# as QgsProcessingParameterFeatureSource
# desc = 'QgsProcessingParameterVectorLayer|in_vector|Input Vector|QgsProcessing.TypeVectorLine;QgsProcessing.TypeVectorPolygon'
# param = getParameterFromString(desc)
# self.assertIsNotNone(param)
# self.assertEqual(param.type(), 'vector')
# self.assertEqual(param.name(), 'in_vector')
# self.assertEqual(param.description(), 'Input Vector')
# self.assertListEqual(param.dataTypes(), [QgsProcessing.TypeVectorLine, QgsProcessing.TypeVectorPolygon])
# self.assertIsNone(param.defaultValue())
# self.assertFalse(param.flags() & QgsProcessingParameterDefinition.FlagOptional)

desc = 'QgsProcessingParameterVectorLayer|in_vector|Input Vector|-1|None|True'
param = getParameterFromString(desc)
Expand Down

0 comments on commit bb5871c

Please sign in to comment.