[GRASS-SVN] r67156 - grass/trunk/lib/python/gunittest

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Dec 15 11:29:51 PST 2015


Author: wenzeslaus
Date: 2015-12-15 11:29:51 -0800 (Tue, 15 Dec 2015)
New Revision: 67156

Modified:
   grass/trunk/lib/python/gunittest/case.py
Log:
gunittest: explicitely check if there is an executable for the module

Modified: grass/trunk/lib/python/gunittest/case.py
===================================================================
--- grass/trunk/lib/python/gunittest/case.py	2015-12-15 19:28:22 UTC (rev 67155)
+++ grass/trunk/lib/python/gunittest/case.py	2015-12-15 19:29:51 UTC (rev 67156)
@@ -19,6 +19,7 @@
 
 from grass.pygrass.modules import Module
 from grass.exceptions import CalledModuleError
+from grass.script import shutil_which
 
 from .gmodules import call_module, SimpleModule
 from .checkers import (check_text_ellipsis,
@@ -1138,6 +1139,9 @@
         """
         module = _module_from_parameters(module, **kwargs)
         _check_module_run_parameters(module)
+        if not shutil_which(module.name):
+            stdmsg = "Cannot find the module '{}'".format(module.name)
+            self.fail(self._formatMessage(msg, stdmsg))
         try:
             module.run()
             self.grass_modules.append(module.name)



More information about the grass-commit mailing list