瀏覽代碼

v.what: fix test

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@74492 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 6 年之前
父節點
當前提交
c3dff5d461
共有 1 個文件被更改,包括 12 次插入12 次删除
  1. 12 12
      vector/v.what/testsuite/test_vwhat_layers.py

+ 12 - 12
vector/v.what/testsuite/test_vwhat_layers.py

@@ -3,7 +3,7 @@ from grass.gunittest.case import TestCase
 from grass.gunittest.main import test
 from grass.gunittest.gmodules import SimpleModule
 
-out1 = """East: 634243
+out1 = u"""East: 634243
 North: 226193
 ------------------------------------------------------------------
 Map: test_vector 
@@ -24,7 +24,7 @@ Category: 4
 """
 
 
-out2 = """East: 634243
+out2 = u"""East: 634243
 North: 226193
 ------------------------------------------------------------------
 Map: test_vector 
@@ -70,7 +70,7 @@ text : yyy
 number : 8.09
 """
 
-out3 = """East=634243
+out3 = u"""East=634243
 North=226193
 
 Map=test_vector
@@ -112,7 +112,7 @@ text=yyy
 number=8.09
 """
 
-out4 = """East=634243
+out4 = u"""East=634243
 North=226193
 
 Map=test_vector
@@ -139,7 +139,7 @@ text=Petrášová
 number=6
 """
 
-out5 = """East=634243
+out5 = u"""East=634243
 North=226193
 
 Map=test_vector
@@ -178,16 +178,16 @@ class TestMultiLayerMap(TestCase):
 
     def test_run(self):
         self.assertModule(self.vwhat)
-        self.assertLooksLike(reference=out1, actual=self.vwhat.outputs.stdout.encode('utf8'))
+        self.assertLooksLike(reference=out1, actual=self.vwhat.outputs.stdout)
 
     def test_print_options(self):
         self.vwhat.flags['a'].value = True
         self.assertModule(self.vwhat)
-        self.assertLooksLike(reference=out2, actual=self.vwhat.outputs.stdout.encode('utf8'))
+        self.assertLooksLike(reference=out2, actual=self.vwhat.outputs.stdout)
 
         self.vwhat.flags['g'].value = True
         self.assertModule(self.vwhat)
-        self.assertLooksLike(reference=out3, actual=self.vwhat.outputs.stdout.encode('utf8'))
+        self.assertLooksLike(reference=out3, actual=self.vwhat.outputs.stdout)
 
     def test_print_options_json(self):
         import json
@@ -195,7 +195,7 @@ class TestMultiLayerMap(TestCase):
         self.vwhat.flags['a'].value = True
         self.assertModule(self.vwhat)
         try:
-            json.loads(self.vwhat.outputs.stdout, encoding='utf-8')
+            json.loads(self.vwhat.outputs.stdout)
         except ValueError:
             self.fail(msg="No JSON object could be decoded:\n" + self.vwhat.outputs.stdout)
 
@@ -204,16 +204,16 @@ class TestMultiLayerMap(TestCase):
         self.vwhat.flags['g'].value = True
         self.vwhat.flags['a'].value = True
         self.assertModule(self.vwhat)
-        self.assertLooksLike(reference=out3, actual=self.vwhat.outputs.stdout.encode('utf8'))
+        self.assertLooksLike(reference=out3, actual=self.vwhat.outputs.stdout)
 
         self.vwhat.inputs.layer = 1
         self.assertModule(self.vwhat)
-        self.assertLooksLike(reference=out4, actual=self.vwhat.outputs.stdout.encode('utf8'))
+        self.assertLooksLike(reference=out4, actual=self.vwhat.outputs.stdout)
 
         self.vwhat.inputs.layer = 2
         self.vwhat.flags['a'].value = False
         self.assertModule(self.vwhat)
-        self.assertLooksLike(reference=out5, actual=self.vwhat.outputs.stdout.encode('utf8'))
+        self.assertLooksLike(reference=out5, actual=self.vwhat.outputs.stdout)
 
 if __name__ == '__main__':
     test()