Changeset 391 for python/trunk/Lib/sqlite3/test/dump.py
- Timestamp:
- Mar 19, 2014, 11:31:01 PM (11 years ago)
- Location:
- python/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/trunk
-
Property svn:mergeinfo
set to
/python/vendor/Python-2.7.6 merged eligible /python/vendor/current merged eligible
-
Property svn:mergeinfo
set to
-
python/trunk/Lib/sqlite3/test/dump.py
r2 r391 14 14 def CheckTableDump(self): 15 15 expected_sqls = [ 16 """CREATE TABLE "index"("index" blob);""" 17 , 18 """INSERT INTO "index" VALUES(X'01');""" 19 , 20 """CREATE TABLE "quoted""table"("quoted""field" text);""" 21 , 22 """INSERT INTO "quoted""table" VALUES('quoted''value');""" 23 , 16 24 "CREATE TABLE t1(id integer primary key, s1 text, " \ 17 25 "t1_i1 integer not null, i2 integer, unique (s1), " \ … … 21 29 , 22 30 "INSERT INTO \"t1\" VALUES(2,'foo2',30,30);" 31 , 32 u"INSERT INTO \"t1\" VALUES(3,'f\xc3\xb6',40,10);" 23 33 , 24 34 "CREATE TABLE t2(id integer, t2_i1 integer, " \ … … 42 52 for i in xrange(len(expected_sqls))] 43 53 54 def CheckUnorderableRow(self): 55 # iterdump() should be able to cope with unorderable row types (issue #15545) 56 class UnorderableRow: 57 def __init__(self, cursor, row): 58 self.row = row 59 def __getitem__(self, index): 60 return self.row[index] 61 self.cx.row_factory = UnorderableRow 62 CREATE_ALPHA = """CREATE TABLE "alpha" ("one");""" 63 CREATE_BETA = """CREATE TABLE "beta" ("two");""" 64 expected = [ 65 "BEGIN TRANSACTION;", 66 CREATE_ALPHA, 67 CREATE_BETA, 68 "COMMIT;" 69 ] 70 self.cu.execute(CREATE_BETA) 71 self.cu.execute(CREATE_ALPHA) 72 got = list(self.cx.iterdump()) 73 self.assertEqual(expected, got) 74 44 75 def suite(): 45 76 return unittest.TestSuite(unittest.makeSuite(DumpTests, "Check"))
Note:
See TracChangeset
for help on using the changeset viewer.