Forráskód Böngészése

fix doctests

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@74325 15284696-431f-4ddb-bdfa-cd5b030d7da7
Stefan Blumentrath 6 éve
szülő
commit
013d72c308

+ 6 - 6
lib/python/pygrass/raster/__init__.py

@@ -85,9 +85,9 @@ class RasterRow(RasterAbstractBase):
         >>> 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 @@ class RasterSegment(RasterAbstractBase):
             >>> 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()
 
         """

+ 1 - 1
lib/python/pygrass/vector/__init__.py

@@ -363,7 +363,7 @@ class VectorTopo(Vector):
             >>> test_vect.number_of("holes")
             0
             >>> test_vect.number_of("lines")
-            21
+            3
             >>> test_vect.number_of("nodes")
             15
             >>> test_vect.number_of("pizza")

+ 1 - 1
lib/python/pygrass/vector/geometry.py

@@ -374,7 +374,7 @@ class Geo(object):
 
             >>> 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))
 

+ 6 - 6
lib/python/pygrass/vector/table.py

@@ -588,15 +588,15 @@ class Link(object):
     >>> 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 @@ class Link(object):
         >>> 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 ...>