Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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 5bcf0f5
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions 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.