Skip to content
Permalink
Browse files

Don't use hardcoded paths in test

  • Loading branch information
nyalldawson committed Apr 9, 2018
1 parent aca75cf commit 8b0418823012f3252513a0853e2554a77b3be2e2
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 8b04188

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