-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[processing] Added packaging tests, to easily check that a qgis insta…
…llation has Processing dependencies
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
''' | ||
Tests to ensure that a QGIS installation contains Processing dependencies | ||
and they are correctly configured by default | ||
''' | ||
import unittest | ||
import sys | ||
from processing.algs.saga.SagaUtils import * | ||
from processing.core.ProcessingConfig import ProcessingConfig | ||
from processing.algs.grass.GrassUtils import GrassUtils | ||
|
||
class PackageTests(unittest.TestCase): | ||
|
||
def testSaga(self): | ||
folder = ProcessingConfig.getSetting(SAGA_FOLDER) | ||
ProcessingConfig.removeSetting(SAGA_FOLDER) | ||
self.assertEqual("2.1.4", getSagaInstalledVersion(True)) | ||
ProcessingConfig.setSettingValue(SAGA_FOLDER, folder) | ||
|
||
def testGrass(self): | ||
folder = ProcessingConfig.getSetting(GrassUtils.GRASS_FOLDER) | ||
ProcessingConfig.removeSetting(GrassUtils.GRASS_FOLDER) | ||
msg = GrassUtils.checkGrassIsInstalled() | ||
self.assertIsNone(msg) | ||
ProcessingConfig.setSettingValue(GrassUtils.GRASS_FOLDER, folder) | ||
|
||
def runTests(): | ||
t = unittest.TestLoader().loadTestsFromTestCase(PackageTests) | ||
unittest.TextTestRunner(verbosity=3, stream=sys.stdout).run(t) |