Skip to content
Permalink
Browse files

[processing] Added packaging tests, to easily check that a qgis insta…

…llation has Processing dependencies
  • Loading branch information
volaya committed May 13, 2015
1 parent 31843a7 commit 5bcf0f52dab696fad8d8d1348d8032bece1a27d5
Showing with 28 additions and 0 deletions.
  1. +28 −0 python/plugins/processing/tests/PackagingTests.py
@@ -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)

0 comments on commit 5bcf0f5

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