summaryrefslogtreecommitdiffstats
path: root/Lib/sqlite3/test
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-05-02 19:09:54 (GMT)
committerGuido van Rossum <guido@python.org>2007-05-02 19:09:54 (GMT)
commitef87d6ed94780fe00250a551031023aeb2898365 (patch)
tree1f8989aaaec7ec5f8b2f26498317f2022bf85531 /Lib/sqlite3/test
parent572dbf8f1320c0b34b9c786e5c30ba4a4b61b292 (diff)
downloadcpython-ef87d6ed94780fe00250a551031023aeb2898365.zip
cpython-ef87d6ed94780fe00250a551031023aeb2898365.tar.gz
cpython-ef87d6ed94780fe00250a551031023aeb2898365.tar.bz2
Rip out all the u"..." literals and calls to unicode().
Diffstat (limited to 'Lib/sqlite3/test')
-rw-r--r--Lib/sqlite3/test/dbapi.py2
-rw-r--r--Lib/sqlite3/test/factory.py20
-rw-r--r--Lib/sqlite3/test/types.py10
-rw-r--r--Lib/sqlite3/test/userfunctions.py12
4 files changed, 22 insertions, 22 deletions
diff --git a/Lib/sqlite3/test/dbapi.py b/Lib/sqlite3/test/dbapi.py
index 5a97acf..99ed02b 100644
--- a/Lib/sqlite3/test/dbapi.py
+++ b/Lib/sqlite3/test/dbapi.py
@@ -612,7 +612,7 @@ class ExtensionTests(unittest.TestCase):
def CheckScriptStringUnicode(self):
con = sqlite.connect(":memory:")
cur = con.cursor()
- cur.executescript(u"""
+ cur.executescript("""
create table a(i);
insert into a(i) values (5);
select i from a;
diff --git a/Lib/sqlite3/test/factory.py b/Lib/sqlite3/test/factory.py
index 8a77d5d..61edc6c 100644
--- a/Lib/sqlite3/test/factory.py
+++ b/Lib/sqlite3/test/factory.py
@@ -139,31 +139,31 @@ class TextFactoryTests(unittest.TestCase):
self.con = sqlite.connect(":memory:")
def CheckUnicode(self):
- austria = unicode("Österreich", "latin1")
+ austria = str("Österreich", "latin1")
row = self.con.execute("select ?", (austria,)).fetchone()
- self.failUnless(type(row[0]) == unicode, "type of row[0] must be unicode")
+ self.failUnless(type(row[0]) == str, "type of row[0] must be unicode")
def CheckString(self):
self.con.text_factory = str
- austria = unicode("Österreich", "latin1")
+ austria = str("Österreich", "latin1")
row = self.con.execute("select ?", (austria,)).fetchone()
self.failUnless(type(row[0]) == str, "type of row[0] must be str")
self.failUnless(row[0] == austria.encode("utf-8"), "column must equal original data in UTF-8")
def CheckCustom(self):
- self.con.text_factory = lambda x: unicode(x, "utf-8", "ignore")
- austria = unicode("Österreich", "latin1")
+ self.con.text_factory = lambda x: str(x, "utf-8", "ignore")
+ austria = str("Österreich", "latin1")
row = self.con.execute("select ?", (austria.encode("latin1"),)).fetchone()
- self.failUnless(type(row[0]) == unicode, "type of row[0] must be unicode")
- self.failUnless(row[0].endswith(u"reich"), "column must contain original data")
+ self.failUnless(type(row[0]) == str, "type of row[0] must be unicode")
+ self.failUnless(row[0].endswith("reich"), "column must contain original data")
def CheckOptimizedUnicode(self):
self.con.text_factory = sqlite.OptimizedUnicode
- austria = unicode("Österreich", "latin1")
- germany = unicode("Deutchland")
+ austria = str("Österreich", "latin1")
+ germany = str("Deutchland")
a_row = self.con.execute("select ?", (austria,)).fetchone()
d_row = self.con.execute("select ?", (germany,)).fetchone()
- self.failUnless(type(a_row[0]) == unicode, "type of non-ASCII row must be unicode")
+ self.failUnless(type(a_row[0]) == str, "type of non-ASCII row must be unicode")
self.failUnless(type(d_row[0]) == str, "type of ASCII-only row must be str")
def tearDown(self):
diff --git a/Lib/sqlite3/test/types.py b/Lib/sqlite3/test/types.py
index a357b2e..232a32c 100644
--- a/Lib/sqlite3/test/types.py
+++ b/Lib/sqlite3/test/types.py
@@ -36,10 +36,10 @@ class SqliteTypeTests(unittest.TestCase):
self.con.close()
def CheckString(self):
- self.cur.execute("insert into test(s) values (?)", (u"Österreich",))
+ self.cur.execute("insert into test(s) values (?)", ("Österreich",))
self.cur.execute("select s from test")
row = self.cur.fetchone()
- self.failUnlessEqual(row[0], u"Österreich")
+ self.failUnlessEqual(row[0], "Österreich")
def CheckSmallInt(self):
self.cur.execute("insert into test(i) values (?)", (42,))
@@ -69,9 +69,9 @@ class SqliteTypeTests(unittest.TestCase):
self.failUnlessEqual(row[0], val)
def CheckUnicodeExecute(self):
- self.cur.execute(u"select 'Österreich'")
+ self.cur.execute("select 'Österreich'")
row = self.cur.fetchone()
- self.failUnlessEqual(row[0], u"Österreich")
+ self.failUnlessEqual(row[0], "Österreich")
class DeclTypesTests(unittest.TestCase):
class Foo:
@@ -166,7 +166,7 @@ class DeclTypesTests(unittest.TestCase):
def CheckUnicode(self):
# default
- val = u"\xd6sterreich"
+ val = "\xd6sterreich"
self.cur.execute("insert into test(u) values (?)", (val,))
self.cur.execute("select u from test")
row = self.cur.fetchone()
diff --git a/Lib/sqlite3/test/userfunctions.py b/Lib/sqlite3/test/userfunctions.py
index a7cdcae..a2f2574 100644
--- a/Lib/sqlite3/test/userfunctions.py
+++ b/Lib/sqlite3/test/userfunctions.py
@@ -28,7 +28,7 @@ import sqlite3 as sqlite
def func_returntext():
return "foo"
def func_returnunicode():
- return u"bar"
+ return "bar"
def func_returnint():
return 42
def func_returnfloat():
@@ -41,7 +41,7 @@ def func_raiseexception():
5/0
def func_isstring(v):
- return type(v) is unicode
+ return type(v) is str
def func_isint(v):
return type(v) is int
def func_isfloat(v):
@@ -100,7 +100,7 @@ class AggrCheckType:
self.val = None
def step(self, whichType, val):
- theType = {"str": unicode, "int": int, "float": float, "None": type(None), "blob": buffer}
+ theType = {"str": str, "int": int, "float": float, "None": type(None), "blob": buffer}
self.val = int(theType[whichType] is type(val))
def finalize(self):
@@ -160,15 +160,15 @@ class FunctionTests(unittest.TestCase):
cur = self.con.cursor()
cur.execute("select returntext()")
val = cur.fetchone()[0]
- self.failUnlessEqual(type(val), unicode)
+ self.failUnlessEqual(type(val), str)
self.failUnlessEqual(val, "foo")
def CheckFuncReturnUnicode(self):
cur = self.con.cursor()
cur.execute("select returnunicode()")
val = cur.fetchone()[0]
- self.failUnlessEqual(type(val), unicode)
- self.failUnlessEqual(val, u"bar")
+ self.failUnlessEqual(type(val), str)
+ self.failUnlessEqual(val, "bar")
def CheckFuncReturnInt(self):
cur = self.con.cursor()