Skip to content

Commit

Permalink
Add provider to test model.
Browse files Browse the repository at this point in the history
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 committed Jul 11, 2012
1 parent 0b8e107 commit 3497758
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/sextante/tests/test.py
Expand Up @@ -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
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 3497758

Please sign in to comment.