[GRASS-SVN] r65834 - grass/trunk/lib/python/gunittest
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Aug 4 15:13:16 PDT 2015
Author: annakrat
Date: 2015-08-04 15:13:16 -0700 (Tue, 04 Aug 2015)
New Revision: 65834
Modified:
grass/trunk/lib/python/gunittest/case.py
Log:
gunittest: add new assert methods
Modified: grass/trunk/lib/python/gunittest/case.py
===================================================================
--- grass/trunk/lib/python/gunittest/case.py 2015-08-04 22:09:13 UTC (rev 65833)
+++ grass/trunk/lib/python/gunittest/case.py 2015-08-04 22:13:16 UTC (rev 65834)
@@ -520,18 +520,36 @@
stdmsg = self._get_detailed_message_about_no_map(name, 'raster')
self.fail(self._formatMessage(msg, stdmsg))
+ def assertRasterDoesNotExist(self, name, msg=None):
+ """Checks if the raster map does not exist in current mapset"""
+ if is_map_in_mapset(name, type='raster'):
+ stdmsg = self._get_detailed_message_about_no_map(name, 'raster')
+ self.fail(self._formatMessage(msg, stdmsg))
+
def assertRaster3dExists(self, name, msg=None):
"""Checks if the 3D raster map exists in current mapset"""
if not is_map_in_mapset(name, type='raster3d'):
stdmsg = self._get_detailed_message_about_no_map(name, 'raster3d')
self.fail(self._formatMessage(msg, stdmsg))
+ def assertRaster3dDoesNotExist(self, name, msg=None):
+ """Checks if the 3D raster map does not exist in current mapset"""
+ if is_map_in_mapset(name, type='raster3d'):
+ stdmsg = self._get_detailed_message_about_no_map(name, 'raster3d')
+ self.fail(self._formatMessage(msg, stdmsg))
+
def assertVectorExists(self, name, msg=None):
"""Checks if the vector map exists in current mapset"""
if not is_map_in_mapset(name, type='vector'):
stdmsg = self._get_detailed_message_about_no_map(name, 'vector')
self.fail(self._formatMessage(msg, stdmsg))
+ def assertVectorDoesNotExist(self, name, msg=None):
+ """Checks if the vector map does not exist in current mapset"""
+ if is_map_in_mapset(name, type='vector'):
+ stdmsg = self._get_detailed_message_about_no_map(name, 'vector')
+ self.fail(self._formatMessage(msg, stdmsg))
+
def assertFileExists(self, filename, msg=None,
skip_size_check=False, skip_access_check=False):
"""Test the existence of a file.
More information about the grass-commit
mailing list