Explorar o código

testsuite: Python3 fix for test_rpatch_artificial.py (fixes https://trac.osgeo.org/grass/ticket/3783) (contributed by pmav99)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@74310 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Neteler %!s(int64=6) %!d(string=hai) anos
pai
achega
1aad055cfa
Modificáronse 1 ficheiros con 7 adicións e 5 borrados
  1. 7 5
      lib/python/gunittest/case.py

+ 7 - 5
lib/python/gunittest/case.py

@@ -675,13 +675,15 @@ class TestCase(unittest.TestCase):
         """
         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)