Skip to content
Permalink
Browse files

Add provider to test model.

git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@296 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
  • Loading branch information
cpolymeris@gmail.com
cpolymeris@gmail.com committed Jul 11, 2012
1 parent 0b8e107 commit 34977582fd2d927fa44bb2e6e57a8c8d8b80b4f2
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/sextante/tests/test.py
@@ -43,6 +43,7 @@
from sextante.parameters.ParameterNumber import ParameterNumber
from sextante.parameters.ParameterString import ParameterString
from sextante.parameters.ParameterBoolean import ParameterBoolean
from sextante.modeler.Providers import Providers
from sextante.outputs.OutputRaster import OutputRaster
from sextante.outputs.OutputVector import OutputVector
from sextante.core.SextanteConfig import SextanteConfig
@@ -91,6 +92,7 @@ def gen_test_parameters(self, alg, doSet = False):
yield l
elif isinstance(p, ParameterVector):
l = QgsVectorLayer('data/vector', "test vector")
#~ l.dataProvider = lambda: DataProviderStub('data/vector')
if doSet: p.setValue(l)
yield l
elif isinstance(p, ParameterNumber):
@@ -182,6 +184,8 @@ def modelSuite(modelFile, dialog = "none", threaded = True, unthreaded = True):
s = unittest.TestSuite()
model = ModelerAlgorithm()
model.openModel(modelFile)
if model.provider is None: # might happen if model is opened from modeler dialog
model.provider = Providers.providers["model"]
if threaded:
s.addTest(SextanteProviderTestCase(modelFile, model, True, dialog))
if unthreaded:

0 comments on commit 3497758

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