瀏覽代碼

pygrass: Fix doctest

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@61884 15284696-431f-4ddb-bdfa-cd5b030d7da7
Pietro Zambelli 10 年之前
父節點
當前提交
b08f242f55
共有 2 個文件被更改,包括 7 次插入6 次删除
  1. 5 5
      lib/python/pygrass/modules/grid/grid.py
  2. 2 1
      lib/python/pygrass/modules/shortcuts.py

+ 5 - 5
lib/python/pygrass/modules/grid/grid.py

@@ -36,7 +36,7 @@ def select(parms, ptype):
     ...              elevation='ele', slope='slp', aspect='asp',
     ...              run_=False)
     >>> for rast in select(slp.outputs, 'raster'):
-    ...     print rast
+    ...     print(rast)
     ...
     slp
     asp
@@ -86,8 +86,8 @@ def copy_mapset(mapset, path):
     [u'PERMANENT', u'user1']
     >>> sorted(os.listdir(os.path.join(path, 'PERMANENT')))
     [u'DEFAULT_WIND', u'PROJ_INFO', u'PROJ_UNITS', u'VAR', u'WIND']
-    >>> sorted(os.listdir(os.path.join(path, 'user1')))
-    [u'CURGROUP', u'SEARCH_PATH', u'VAR', u'WIND']
+    >>> sorted(os.listdir(os.path.join(path, 'user1'))) # doctest: +ELLIPSIS
+    [...u'SEARCH_PATH', u'VAR', u'WIND']
     >>> import shutil
     >>> shutil.rmtree(path)
 
@@ -308,7 +308,7 @@ def get_cmd(cmdd):
     ...              elevation='ele', slope='slp', aspect='asp',
     ...              overwrite=True, run_=False)
     >>> get_cmd(slp.get_dict())  # doctest: +ELLIPSIS
-    ['r.slope.aspect', 'elevation=ele', 'format=degrees', ..., '--o']
+    ['r.slope.aspect', u'elevation=ele', u'format=degrees', ..., u'--o']
     """
     cmd = [cmdd['name'], ]
     cmd.extend(("%s=%s" % (k, v) for k, v in cmdd['inputs']
@@ -391,7 +391,7 @@ class GridModule(object):
     :param run_: if False only instantiate the object
     :type run_: bool
     :param args: give all the parameters to the command
-    :param kargs: give all the parameters to the command 
+    :param kargs: give all the parameters to the command
 
     >>> grd = GridModule('r.slope.aspect',
     ...                  width=500, height=500, overlap=2,

+ 2 - 1
lib/python/pygrass/modules/shortcuts.py

@@ -28,8 +28,9 @@ class MetaModule(object):
        >>> g_mlist.inputs.type = 'rast'
        >>> g_mlist.stdout_ = -1
        >>> g_mlist.run()
+       Module('g.mlist')
        >>> g_mlist.outputs.stdout                         # doctest: +ELLIPSIS
-       'basins...soils...'
+       '...basins...soils...'
        >>> r = MetaModule('r')
        >>> what = r.what
        >>> what.description