Skip to content

Commit

Permalink
Don't use hardcoded paths in test
Browse files Browse the repository at this point in the history
(cherry-picked from 8b04188)
  • Loading branch information
nyalldawson committed Apr 9, 2018
1 parent 1c2103d commit 2992d6d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions python/plugins/processing/tests/Grass7AlgorithmsVectorTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import nose2
import shutil
import os
import tempfile

from qgis.core import (QgsVectorLayer,
QgsApplication,
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 2992d6d

Please sign in to comment.