1
- #-*- coding: iso-8859-1 -*-
2
1
# pysqlite2/test/factory.py: tests for the various factories in pysqlite
3
2
#
4
- # Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
3
+ # Copyright (C) 2005-2007 Gerhard Häring <gh@ghaering.de>
5
4
#
6
5
# This file is part of pysqlite.
7
6
#
@@ -235,20 +234,20 @@ def setUp(self):
235
234
self .con = sqlite .connect (":memory:" )
236
235
237
236
def test_unicode (self ):
238
- austria = "Österreich"
237
+ austria = "Österreich"
239
238
row = self .con .execute ("select ?" , (austria ,)).fetchone ()
240
239
self .assertEqual (type (row [0 ]), str , "type of row[0] must be unicode" )
241
240
242
241
def test_string (self ):
243
242
self .con .text_factory = bytes
244
- austria = "Österreich"
243
+ austria = "Österreich"
245
244
row = self .con .execute ("select ?" , (austria ,)).fetchone ()
246
245
self .assertEqual (type (row [0 ]), bytes , "type of row[0] must be bytes" )
247
246
self .assertEqual (row [0 ], austria .encode ("utf-8" ), "column must equal original data in UTF-8" )
248
247
249
248
def test_custom (self ):
250
249
self .con .text_factory = lambda x : str (x , "utf-8" , "ignore" )
251
- austria = "Österreich"
250
+ austria = "Österreich"
252
251
row = self .con .execute ("select ?" , (austria ,)).fetchone ()
253
252
self .assertEqual (type (row [0 ]), str , "type of row[0] must be unicode" )
254
253
self .assertTrue (row [0 ].endswith ("reich" ), "column must contain original data" )
@@ -258,7 +257,7 @@ def test_optimized_unicode(self):
258
257
with self .assertWarns (DeprecationWarning ) as cm :
259
258
self .con .text_factory = sqlite .OptimizedUnicode
260
259
self .assertIn ("factory.py" , cm .filename )
261
- austria = "Österreich"
260
+ austria = "Österreich"
262
261
germany = "Deutchland"
263
262
a_row = self .con .execute ("select ?" , (austria ,)).fetchone ()
264
263
d_row = self .con .execute ("select ?" , (germany ,)).fetchone ()
0 commit comments