Skip to content
Permalink
Browse files

Don't use hardcoded paths in test

(cherry-picked from 8b04188)
  • Loading branch information
nyalldawson committed Apr 9, 2018
1 parent 1c2103d commit 2992d6d58d777d8fd9f3ce24545d872df26bb5e5
Showing with 7 additions and 2 deletions.
  1. +7 −2 python/plugins/processing/tests/Grass7AlgorithmsVectorTest.py
@@ -30,6 +30,7 @@
import nose2
import shutil
import os
import tempfile

from qgis.core import (QgsVectorLayer,
QgsApplication,
@@ -56,6 +57,9 @@ def setUpClass(cls):
Processing.initialize()
cls.cleanup_paths = []

cls.temp_dir = tempfile.mkdtemp()
cls.cleanup_paths.append(cls.temp_dir)

assert Grass7Utils.installedVersion()

@classmethod
@@ -88,7 +92,8 @@ def testMemoryLayerInput(self):

alg = QgsApplication.processingRegistry().createAlgorithmById('grass7:v.buffer')
self.assertIsNotNone(alg)
temp_file = '/tmp/grass_output.shp'

temp_file = os.path.join(self.temp_dir,'grass_output.shp')
parameters ={'input':'testmem',
'type':[0,1,4],
'distance':1,
@@ -138,7 +143,7 @@ def testFeatureSourceInput(self):

alg = QgsApplication.processingRegistry().createAlgorithmById('grass7:v.buffer')
self.assertIsNotNone(alg)
temp_file = '/tmp/grass_output.shp'
temp_file = os.path.join(self.temp_dir,'grass_output_sel.shp')
parameters = {'input': QgsProcessingFeatureSourceDefinition('testmem', True),
'type': [0, 1, 4],
'distance': 1,

0 comments on commit 2992d6d

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