File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
python/plugins/processing/tests Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change
1
+ '''
2
+ Tests to ensure that a QGIS installation contains Processing dependencies
3
+ and they are correctly configured by default
4
+ '''
5
+ import unittest
6
+ import sys
7
+ from processing .algs .saga .SagaUtils import *
8
+ from processing .core .ProcessingConfig import ProcessingConfig
9
+ from processing .algs .grass .GrassUtils import GrassUtils
10
+
11
+ class PackageTests (unittest .TestCase ):
12
+
13
+ def testSaga (self ):
14
+ folder = ProcessingConfig .getSetting (SAGA_FOLDER )
15
+ ProcessingConfig .removeSetting (SAGA_FOLDER )
16
+ self .assertEqual ("2.1.4" , getSagaInstalledVersion (True ))
17
+ ProcessingConfig .setSettingValue (SAGA_FOLDER , folder )
18
+
19
+ def testGrass (self ):
20
+ folder = ProcessingConfig .getSetting (GrassUtils .GRASS_FOLDER )
21
+ ProcessingConfig .removeSetting (GrassUtils .GRASS_FOLDER )
22
+ msg = GrassUtils .checkGrassIsInstalled ()
23
+ self .assertIsNone (msg )
24
+ ProcessingConfig .setSettingValue (GrassUtils .GRASS_FOLDER , folder )
25
+
26
+ def runTests ():
27
+ t = unittest .TestLoader ().loadTestsFromTestCase (PackageTests )
28
+ unittest .TextTestRunner (verbosity = 3 , stream = sys .stdout ).run (t )
You can’t perform that action at this time.
0 commit comments