浏览代码

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 6 年之前
父节点
当前提交
1aad055cfa
共有 1 个文件被更改,包括 7 次插入5 次删除
  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
         diff = self._get_unique_name('compute_difference_raster_' + name_part
                                      + '_' + first + '_minus_' + second)
                                      + '_' + 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
         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
     # TODO: this method is almost the same as the one for 2D
     def _compute_difference_raster3d(self, first, second, name_part):
     def _compute_difference_raster3d(self, first, second, name_part):
         """Compute difference of two rasters (first - second)
         """Compute difference of two rasters (first - second)