[Thuban-commits] r2838 - in branches/WIP-pyshapelib-Unicode/thuban: . test

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Feb 14 00:47:22 CET 2008


Author: bernhard
Date: 2008-02-14 00:47:20 +0100 (Thu, 14 Feb 2008)
New Revision: 2838

Modified:
   branches/WIP-pyshapelib-Unicode/thuban/ChangeLog
   branches/WIP-pyshapelib-Unicode/thuban/test/test_load_1_0.py
Log:
* test/test_load_1_0.py( TestNonAsciiColumnName): Compare result
of layer.GetClassificationColumn() with string in internal encoding,
this makes this test work with --internal-encoding=uncode.
Given that the new dbflib should deal with unicode objects,
call dbf.add_field with an unicode object.


Modified: branches/WIP-pyshapelib-Unicode/thuban/ChangeLog
===================================================================
--- branches/WIP-pyshapelib-Unicode/thuban/ChangeLog	2008-02-13 22:31:31 UTC (rev 2837)
+++ branches/WIP-pyshapelib-Unicode/thuban/ChangeLog	2008-02-13 23:47:20 UTC (rev 2838)
@@ -1,3 +1,11 @@
+2008-02-14  Bernhard Reiter <bernhard at intevation.de>
+
+	* test/test_load_1_0.py( TestNonAsciiColumnName): Compare result
+	of layer.GetClassificationColumn() with string in internal encoding,
+	this makes this test work with --internal-encoding=uncode.
+	Given that the new dbflib should deal with unicode objects,
+	call dbf.add_field with an unicode object.
+
 2008-02-04	Bram de Greve <bram.degreve at bramz.net>
 
 	* Forward porting trunk (2819:2834] to WIP-pyshapelib-Unicode branch.

Modified: branches/WIP-pyshapelib-Unicode/thuban/test/test_load_1_0.py
===================================================================
--- branches/WIP-pyshapelib-Unicode/thuban/test/test_load_1_0.py	2008-02-13 22:31:31 UTC (rev 2837)
+++ branches/WIP-pyshapelib-Unicode/thuban/test/test_load_1_0.py	2008-02-13 23:47:20 UTC (rev 2838)
@@ -276,7 +276,7 @@
         dbffile = self.temp_file_name("TestNonAsciiColumnName.dbf")
         shpfile = self.temp_file_name("TestNonAsciiColumnName.shp")
         dbf = dbflib.create(dbffile)
-        dbf.add_field('Fl\xe4che', dbflib.FTDouble, 10, 5)
+        dbf.add_field(u'Fl\xe4che', dbflib.FTDouble, 10, 5)
         dbf.write_record(0, (0.0,))
         dbf.close()
         shp = shapelib.create(shpfile, shapelib.SHPT_POLYGON)
@@ -306,7 +306,8 @@
         # too
         layer = session.Maps()[0].Layers()[0]
         try:
-            self.assertEquals(layer.GetClassificationColumn(), 'Fl\xe4che')
+            self.assertEquals(layer.GetClassificationColumn(), 
+                internal_from_unicode(u'Fl\xe4che'))
         except UnicodeError:
             # FIXME: Obviously this will have to change if Thuban ever
             # supports unicode properly.



More information about the Thuban-commits mailing list