Skip to content
Permalink
Browse files

[processing] fix GRASS vector tests

  • Loading branch information
alexbruy committed May 15, 2018
1 parent cf59968 commit 8aa56fc38f249fe882fe96397d1e8634303de561
@@ -862,7 +862,7 @@ def exportVectorLayerFromParameter(self, name, parameters, context, layer=None,
if layerType in self.QGIS_OUTPUT_TYPES:
dataType = self.QGIS_OUTPUT_TYPES[layerType]

outFormat = QgsVectorFileWriter.driverForExtension(os.path.splitext(fileName)[1])
outFormat = QgsVectorFileWriter.driverForExtension(os.path.splitext(fileName)[1]).replace(' ', '_')
dsco = self.parameterAsString(parameters, self.GRASS_VECTOR_DSCO, context)
lco = self.parameterAsString(parameters, self.GRASS_VECTOR_LCO, context)
self.exportVectorLayer(grassName, fileName, layer, nocats, dataType, outFormat, dsco, lco)
@@ -95,17 +95,25 @@ def testMemoryLayerInput(self):

temp_file = os.path.join(self.temp_dir, 'grass_output.shp')
parameters = {'input': 'testmem',
'cats': '',
'where': '',
'type': [0, 1, 4],
'distance': 1,
'minordistance': None,
'angle': 0,
'column': None,
'scale': 1,
'tolerance': 0.01,
'-s': False,
'-c': False,
'-t': False,
'output': temp_file,
'GRASS_SNAP_TOLERANCE_PARAMETER': -1, 'GRASS_MIN_AREA_PARAMETER': 0.0001,
'GRASS_OUTPUT_TYPE_PARAMETER': 0}
'GRASS_REGION_PARAMETER': None,
'GRASS_SNAP_TOLERANCE_PARAMETER': -1,
'GRASS_MIN_AREA_PARAMETER': 0.0001,
'GRASS_OUTPUT_TYPE_PARAMETER': 0,
'GRASS_VECTOR_DSCO': '',
'GRASS_VECTOR_LCO': ''}
feedback = QgsProcessingFeedback()

results, ok = alg.run(parameters, context, feedback)
@@ -146,17 +154,25 @@ def testFeatureSourceInput(self):
self.assertIsNotNone(alg)
temp_file = os.path.join(self.temp_dir, 'grass_output_sel.shp')
parameters = {'input': QgsProcessingFeatureSourceDefinition('testmem', True),
'cats': '',
'where': '',
'type': [0, 1, 4],
'distance': 1,
'minordistance': None,
'angle': 0,
'column': None,
'scale': 1,
'tolerance': 0.01,
'-s': False,
'-c': False,
'-t': False,
'output': temp_file,
'GRASS_SNAP_TOLERANCE_PARAMETER': -1, 'GRASS_MIN_AREA_PARAMETER': 0.0001,
'GRASS_OUTPUT_TYPE_PARAMETER': 0}
'GRASS_REGION_PARAMETER': None,
'GRASS_SNAP_TOLERANCE_PARAMETER': -1,
'GRASS_MIN_AREA_PARAMETER': 0.0001,
'GRASS_OUTPUT_TYPE_PARAMETER': 0,
'GRASS_VECTOR_DSCO': '',
'GRASS_VECTOR_LCO': ''}
feedback = QgsProcessingFeedback()

results, ok = alg.run(parameters, context, feedback)

0 comments on commit 8aa56fc

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