Skip to content

Commit f969579

Browse files
author
cpolymeris@gmail.com
committed
Model test changes.
git-svn-id: http://sextante.googlecode.com/svn/trunk/soft/bindings/qgis-plugin@294 881b9c09-3ef8-f3c2-ec3d-21d735c97f4d
1 parent 843285d commit f969579

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/sextante/tests/test.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ def setUp(self):
140140
print ' => ', self.args, bcolors.WARNING,
141141

142142
def runalg_none(self):
143-
result = Sextante.runalg(self.algId, *self.args)
143+
result = Sextante.runalg(self.alg, *self.args)
144144
print bcolors.ENDC
145145
self.assertIsNotNone(result, self.msg)
146146
if not result:
@@ -178,11 +178,14 @@ def algSuite(dialog = "none", threaded = True, unthreaded = True, provider = Non
178178
s.addTest(SextanteProviderTestCase(algId, alg, False, dialog))
179179
return s
180180

181-
def modelSuite(modelFile, threaded = True, unthreaded = True):
181+
def modelSuite(modelFile, dialog = "none", threaded = True, unthreaded = True):
182182
s = unittest.TestSuite()
183183
model = ModelerAlgorithm()
184184
model.openModel(modelFile)
185-
s.addTest(SextanteProviderTestCase(modelFile, model, True))
185+
if threaded:
186+
s.addTest(SextanteProviderTestCase(modelFile, model, True, dialog))
187+
if unthreaded:
188+
s.addTest(SextanteProviderTestCase(modelFile, model, False, dialog))
186189
return s
187190

188191
if __name__ == '__main__':
@@ -204,6 +207,7 @@ def modelSuite(modelFile, threaded = True, unthreaded = True):
204207
threaded = not args.uOnly or args.tOnly
205208
unthreaded = not args.tOnly or args.uOnly
206209

210+
207211
try:
208212
loadSuite = unittest.TestLoader().loadTestsFromTestCase(SextantePluginTest)
209213
unittest.TextTestRunner(verbosity=2).run(loadSuite)
@@ -213,9 +217,9 @@ def modelSuite(modelFile, threaded = True, unthreaded = True):
213217
print "No data under %s or %s. Run with -h argument for help" % (args.raster, args.vector)
214218
exit(1)
215219
if args.model:
216-
unittest.TextTestRunner(verbosity=2).run(modelSuite(args.model or 'data/model', threaded, unthreaded))
220+
unittest.TextTestRunner(verbosity=2).run(modelSuite(args.model or 'data/model', args.dialog, threaded, unthreaded))
217221
exit(0)
218-
unittest.TextTestRunner(verbosity=2).run(algSuite(args.dialog, threaded, unthreaded))
222+
unittest.TextTestRunner(verbosity=2).run(algSuite(args.dialog, threaded, unthreaded, args.dialog))
219223
except KeyboardInterrupt:
220224
print bcolors.ENDC, "Test interrupted."
221225

0 commit comments

Comments
 (0)