浏览代码

libpython/script: fix tests (#1381)

Anna Petrasova 4 年之前
父节点
当前提交
7da47c1c0c
共有 2 个文件被更改,包括 1 次插入3 次删除
  1. 0 1
      python/grass/script/array.py
  2. 1 2
      python/grass/script/testsuite/test_names.py

+ 0 - 1
python/grass/script/array.py

@@ -10,7 +10,6 @@ Usage:
 >>> # We create a temporary region that is only valid in this python session
 ... gs.use_temp_region()
 >>> gs.run_command("g.region", n=80, e=120, t=60, s=0, w=0, b=0, res=20, res3=20)
-0
 >>>
 >>> # Lets create a raster map numpy array
 ... # based at the current region settings

+ 1 - 2
python/grass/script/testsuite/test_names.py

@@ -1,6 +1,5 @@
 # -*- coding: utf-8 -*-
 import os
-import sys
 import platform
 
 from grass.gunittest.case import TestCase
@@ -20,7 +19,7 @@ class TestUnique(TestCase):
         self.assertIn(base_name, full_name)
         self.assertGreater(len(full_name), len(base_name))
         self.assertIn(str(os.getpid()), full_name)
-        self.assertIn(platform.node(), full_name)
+        self.assertIn(utils.legalize_vector_name(platform.node()), full_name)
         self.assertTrue(legal_name(full_name))
         # TODO: It should be also a valid vector name
         # but we don't have a function for that (same for all)