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

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Mar 26 16:21:03 PDT 2019


Author: neteler
Date: 2019-03-26 16:21:03 -0700 (Tue, 26 Mar 2019)
New Revision: 74310

Modified:
   grass/trunk/lib/python/gunittest/case.py
Log:
testsuite: Python3 fix for test_rpatch_artificial.py (fixes #3783) (contributed by pmav99)

Modified: grass/trunk/lib/python/gunittest/case.py
===================================================================
--- grass/trunk/lib/python/gunittest/case.py	2019-03-26 23:17:49 UTC (rev 74309)
+++ grass/trunk/lib/python/gunittest/case.py	2019-03-26 23:21:03 UTC (rev 74310)
@@ -675,13 +675,15 @@
         """
         diff = self._get_unique_name('compute_difference_raster_' + name_part
                                      + '_' + first + '_minus_' + second)
-        call_module('r.mapcalc',
-                    stdin='"{d}" = "{f}" - "{s}"'.format(d=diff,
-                                                         f=first,
-                                                         s=second))
+        expression = '"{diff}" = "{first}" - "{second}"'.format(
+            diff=diff,
+            first=first,
+            second=second
+        )
+        call_module('r.mapcalc', stdin=expression.encode("utf-8"))
         return diff
 
-    # TODO: name of map generation is repeted three times
+    # TODO: name of map generation is repeated three times
     # TODO: this method is almost the same as the one for 2D
     def _compute_difference_raster3d(self, first, second, name_part):
         """Compute difference of two rasters (first - second)



More information about the grass-commit mailing list