mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-15 00:04:37 -04:00
28 lines
1.1 KiB
Python
28 lines
1.1 KiB
Python
'''
|
|
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) |