Skip to content
Permalink
Browse files

make advanced params optional to keep algorithm API stable

  • Loading branch information
alexbruy committed Dec 31, 2018
1 parent 3d33b9f commit c64383702effc391d6031d0d1f500cf8b019d4d9
@@ -83,12 +83,14 @@ def initAlgorithm(self, config=None):
self.tr('Resampling method'),
options=[i[0] for i in self.methods],
allowMultiple=False,
defaultValue=0))
defaultValue=0,
optional=True))
params.append(QgsProcessingParameterEnum(self.FORMAT,
self.tr('Overviews format'),
options=self.formats,
allowMultiple=False,
defaultValue=0))
defaultValue=0,
optional=True))
for p in params:
p.setFlags(p.flags() | QgsProcessingParameterDefinition.FlagAdvanced)
self.addParameter(p)
@@ -2440,6 +2440,14 @@ def testGdalAddo(self):
['gdaladdo',
source + ' ' + '-r nearest 2 4 8 16 32 64'])

# without advanced params
self.assertEqual(
alg.getConsoleCommands({'INPUT': source,
'LEVELS': '2 4 8 16',
'CLEAN': False}, context, feedback),
['gdaladdo',
source + ' ' + '-r nearest 2 4 8 16'])


class TestGdalOgrToPostGis(unittest.TestCase):

0 comments on commit c643837

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