55
55
class AlgorithmDialogTest (unittest .TestCase ):
56
56
57
57
def testCreation (self ):
58
- alg = QgsApplication .processingRegistry ().algorithmById ('native:centroids' )
58
+ alg = QgsApplication .processingRegistry ().createAlgorithmById ('native:centroids' )
59
59
a = AlgorithmDialog (alg )
60
60
self .assertEqual (a .mainWidget ().alg , alg )
61
61
@@ -67,7 +67,7 @@ def setUpClass(cls):
67
67
ProcessingConfig .initialize ()
68
68
69
69
def checkConstructWrapper (self , param , expected_wrapper_class ):
70
- alg = QgsApplication .processingRegistry ().algorithmById ('native:centroids' )
70
+ alg = QgsApplication .processingRegistry ().createAlgorithmById ('native:centroids' )
71
71
72
72
# algorithm dialog
73
73
dlg = AlgorithmDialog (alg )
@@ -77,6 +77,7 @@ def checkConstructWrapper(self, param, expected_wrapper_class):
77
77
self .assertEqual (wrapper .dialog , dlg )
78
78
self .assertIsNotNone (wrapper .widget )
79
79
80
+ alg = QgsApplication .processingRegistry ().createAlgorithmById ('native:centroids' )
80
81
# batch dialog
81
82
dlg = BatchAlgorithmDialog (alg )
82
83
wrapper = WidgetWrapperFactory .create_wrapper_from_class (param , dlg )
@@ -85,6 +86,8 @@ def checkConstructWrapper(self, param, expected_wrapper_class):
85
86
self .assertEqual (wrapper .dialog , dlg )
86
87
self .assertIsNotNone (wrapper .widget )
87
88
89
+ alg = QgsApplication .processingRegistry ().createAlgorithmById ('native:centroids' )
90
+
88
91
# modeler dialog
89
92
model = QgsProcessingModelAlgorithm ()
90
93
dlg = ModelerParametersDialog (alg , model )
@@ -138,7 +141,7 @@ def testSource(self):
138
141
self .assertTrue (layer .isValid ())
139
142
QgsProject .instance ().addMapLayer (layer )
140
143
141
- alg = QgsApplication .processingRegistry ().algorithmById ('native:centroids' )
144
+ alg = QgsApplication .processingRegistry ().createAlgorithmById ('native:centroids' )
142
145
dlg = AlgorithmDialog (alg )
143
146
param = QgsProcessingParameterFeatureSource ('test' )
144
147
wrapper = FeatureSourceWidgetWrapper (param , dlg )
@@ -175,7 +178,7 @@ def testRange(self):
175
178
# minimal test to check if wrapper generate GUI for each processign context
176
179
self .checkConstructWrapper (QgsProcessingParameterRange ('test' ), RangeWidgetWrapper )
177
180
178
- alg = QgsApplication .processingRegistry ().algorithmById ('native:centroids' )
181
+ alg = QgsApplication .processingRegistry ().createAlgorithmById ('native:centroids' )
179
182
dlg = AlgorithmDialog (alg )
180
183
param = QgsProcessingParameterRange (
181
184
name = 'test' ,
@@ -237,7 +240,7 @@ def testMapLayer(self):
237
240
def testDistance (self ):
238
241
self .checkConstructWrapper (QgsProcessingParameterDistance ('test' ), DistanceWidgetWrapper )
239
242
240
- alg = QgsApplication .processingRegistry ().algorithmById ('native:centroids' )
243
+ alg = QgsApplication .processingRegistry ().createAlgorithmById ('native:centroids' )
241
244
dlg = AlgorithmDialog (alg )
242
245
param = QgsProcessingParameterDistance ('test' )
243
246
wrapper = DistanceWidgetWrapper (param , dlg )
@@ -322,7 +325,7 @@ def testDistance(self):
322
325
def testMatrix (self ):
323
326
self .checkConstructWrapper (QgsProcessingParameterMatrix ('test' ), FixedTableWidgetWrapper )
324
327
325
- alg = QgsApplication .processingRegistry ().algorithmById ('native:centroids' )
328
+ alg = QgsApplication .processingRegistry ().createAlgorithmById ('native:centroids' )
326
329
dlg = AlgorithmDialog (alg )
327
330
param = QgsProcessingParameterMatrix ('test' , 'test' , 2 , True , ['x' , 'y' ], [['a' , 'b' ], ['c' , 'd' ]])
328
331
wrapper = FixedTableWidgetWrapper (param , dlg )
@@ -346,7 +349,7 @@ def testBand(self):
346
349
347
350
def testFeatureSink (self ):
348
351
param = QgsProcessingParameterFeatureSink ('test' )
349
- alg = QgsApplication .processingRegistry ().algorithmById ('native:centroids' )
352
+ alg = QgsApplication .processingRegistry ().createAlgorithmById ('native:centroids' )
350
353
panel = DestinationSelectionPanel (param , alg )
351
354
352
355
panel .setValue ('memory:' )
@@ -382,7 +385,7 @@ def testFeatureSink(self):
382
385
383
386
def testVectorDestination (self ):
384
387
param = QgsProcessingParameterVectorDestination ('test' )
385
- alg = QgsApplication .processingRegistry ().algorithmById ('native:centroids' )
388
+ alg = QgsApplication .processingRegistry ().createAlgorithmById ('native:centroids' )
386
389
panel = DestinationSelectionPanel (param , alg )
387
390
388
391
panel .setValue ('''ogr:dbname='/me/a.gpkg' table="d" (geom) sql=''' )
@@ -412,7 +415,7 @@ def testVectorDestination(self):
412
415
413
416
def testRasterDestination (self ):
414
417
param = QgsProcessingParameterRasterDestination ('test' )
415
- alg = QgsApplication .processingRegistry ().algorithmById ('native:centroids' )
418
+ alg = QgsApplication .processingRegistry ().createAlgorithmById ('native:centroids' )
416
419
panel = DestinationSelectionPanel (param , alg )
417
420
418
421
panel .setValue ('/home/me/test.tif' )
@@ -430,7 +433,7 @@ def testRasterDestination(self):
430
433
431
434
def testFolderDestination (self ):
432
435
param = QgsProcessingParameterFolderDestination ('test' )
433
- alg = QgsApplication .processingRegistry ().algorithmById ('native:centroids' )
436
+ alg = QgsApplication .processingRegistry ().createAlgorithmById ('native:centroids' )
434
437
panel = DestinationSelectionPanel (param , alg )
435
438
436
439
panel .setValue ('/home/me/test.tif' )
@@ -444,7 +447,7 @@ def testFolderDestination(self):
444
447
445
448
def testFileDestination (self ):
446
449
param = QgsProcessingParameterFileDestination ('test' )
447
- alg = QgsApplication .processingRegistry ().algorithmById ('native:centroids' )
450
+ alg = QgsApplication .processingRegistry ().createAlgorithmById ('native:centroids' )
448
451
panel = DestinationSelectionPanel (param , alg )
449
452
450
453
panel .setValue ('/home/me/test.tif' )
0 commit comments