[GRASS-SVN] r74325 - in grass/trunk/lib/python/pygrass: raster vector

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Mar 28 08:13:13 PDT 2019


Author: sbl
Date: 2019-03-28 08:13:13 -0700 (Thu, 28 Mar 2019)
New Revision: 74325

Modified:
   grass/trunk/lib/python/pygrass/raster/__init__.py
   grass/trunk/lib/python/pygrass/vector/__init__.py
   grass/trunk/lib/python/pygrass/vector/geometry.py
   grass/trunk/lib/python/pygrass/vector/table.py
Log:
fix doctests

Modified: grass/trunk/lib/python/pygrass/raster/__init__.py
===================================================================
--- grass/trunk/lib/python/pygrass/raster/__init__.py	2019-03-28 14:23:43 UTC (rev 74324)
+++ grass/trunk/lib/python/pygrass/raster/__init__.py	2019-03-28 15:13:13 UTC (rev 74325)
@@ -85,9 +85,9 @@
         >>> elev.hist.title = "A test map"
         >>> elev.hist.write()
         >>> elev.hist.title
-        'A test map'
+        u'A test map'
         >>> elev.hist.keyword
-        'This is a test map'
+        u'This is a test map'
 
         >>> attrs = list(elev.hist)
         >>> attrs[0]
@@ -487,10 +487,10 @@
             >>> map_b.open("r")
             >>> for row in map_b:
             ...         row
-            Buffer([ 111.,  121.,  131.,  141.], dtype=float32)
-            Buffer([ 112.,  122.,  132.,  142.], dtype=float32)
-            Buffer([ 113.,  123.,  133.,  143.], dtype=float32)
-            Buffer([ 114.,  124.,  134.,  144.], dtype=float32)
+            Buffer([111., 121., 131., 141.], dtype=float32)
+            Buffer([112., 122., 132., 142.], dtype=float32)
+            Buffer([113., 123., 133., 143.], dtype=float32)
+            Buffer([114., 124., 134., 144.], dtype=float32)
             >>> map_b.close()
 
         """

Modified: grass/trunk/lib/python/pygrass/vector/__init__.py
===================================================================
--- grass/trunk/lib/python/pygrass/vector/__init__.py	2019-03-28 14:23:43 UTC (rev 74324)
+++ grass/trunk/lib/python/pygrass/vector/__init__.py	2019-03-28 15:13:13 UTC (rev 74325)
@@ -363,7 +363,7 @@
             >>> test_vect.number_of("holes")
             0
             >>> test_vect.number_of("lines")
-            21
+            3
             >>> test_vect.number_of("nodes")
             15
             >>> test_vect.number_of("pizza")

Modified: grass/trunk/lib/python/pygrass/vector/geometry.py
===================================================================
--- grass/trunk/lib/python/pygrass/vector/geometry.py	2019-03-28 14:23:43 UTC (rev 74324)
+++ grass/trunk/lib/python/pygrass/vector/geometry.py	2019-03-28 15:13:13 UTC (rev 74325)
@@ -374,7 +374,7 @@
 
             >>> pnt = Point(10, 100)
             >>> pnt.to_wkt()
-            'POINT (10.0000000000000000 100.0000000000000000)'
+            u'POINT (10.0000000000000000 100.0000000000000000)'
         """
         return decode(libvect.Vect_line_to_wkt(self.c_points, self.gtype, not self.is2D))
 

Modified: grass/trunk/lib/python/pygrass/vector/table.py
===================================================================
--- grass/trunk/lib/python/pygrass/vector/table.py	2019-03-28 14:23:43 UTC (rev 74324)
+++ grass/trunk/lib/python/pygrass/vector/table.py	2019-03-28 15:13:13 UTC (rev 74325)
@@ -588,15 +588,15 @@
     >>> link.layer
     1
     >>> link.name
-    'link0'
+    u'link0'
     >>> link.table_name
-    'table_doctest_map'
+    u'table_doctest_map'
     >>> link.key
-    'cat'
+    u'cat'
     >>> link.database
-    '$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db'
+    u'$GISDBASE/$LOCATION_NAME/$MAPSET/sqlite/sqlite.db'
     >>> link.driver
-    'sqlite'
+    u'sqlite'
     >>> link
     Link(1, link0, sqlite)
 
@@ -737,7 +737,7 @@
         >>> conn = link.connection()
         >>> cur = conn.cursor()
         >>> link.table_name
-        'table_doctest_map'
+        u'table_doctest_map'
         >>> cur.execute("SELECT cat, name, value from %s" %
         ...             link.table_name)              # doctest: +ELLIPSIS
         <sqlite3.Cursor object at ...>



More information about the grass-commit mailing list