Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
sqlite3.test.dump.DumpTests Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def CheckTableDump

Public Attributes

 cx
 cu

Detailed Description

Definition at line 6 of file dump.py.


Member Function Documentation

Definition at line 14 of file dump.py.

00014 
00015     def CheckTableDump(self):
00016         expected_sqls = [
00017                 "CREATE TABLE t1(id integer primary key, s1 text, " \
00018                 "t1_i1 integer not null, i2 integer, unique (s1), " \
00019                 "constraint t1_idx1 unique (i2));"
00020                 ,
00021                 "INSERT INTO \"t1\" VALUES(1,'foo',10,20);"
00022                 ,
00023                 "INSERT INTO \"t1\" VALUES(2,'foo2',30,30);"
00024                 ,
00025                 "CREATE TABLE t2(id integer, t2_i1 integer, " \
00026                 "t2_i2 integer, primary key (id)," \
00027                 "foreign key(t2_i1) references t1(t1_i1));"
00028                 ,
00029                 "CREATE TRIGGER trigger_1 update of t1_i1 on t1 " \
00030                 "begin " \
00031                 "update t2 set t2_i1 = new.t1_i1 where t2_i1 = old.t1_i1; " \
00032                 "end;"
00033                 ,
00034                 "CREATE VIEW v1 as select * from t1 left join t2 " \
00035                 "using (id);"
00036                 ]
00037         [self.cu.execute(s) for s in expected_sqls]
00038         i = self.cx.iterdump()
00039         actual_sqls = [s for s in i]
00040         expected_sqls = ['BEGIN TRANSACTION;'] + expected_sqls + \
00041             ['COMMIT;']
00042         [self.assertEqual(expected_sqls[i], actual_sqls[i])
00043             for i in range(len(expected_sqls))]

Here is the call graph for this function:

Definition at line 7 of file dump.py.

00007 
00008     def setUp(self):
00009         self.cx = sqlite.connect(":memory:")
00010         self.cu = self.cx.cursor()

Here is the caller graph for this function:

Definition at line 11 of file dump.py.

00011 
00012     def tearDown(self):
00013         self.cx.close()

Here is the caller graph for this function:


Member Data Documentation

Definition at line 9 of file dump.py.

Definition at line 8 of file dump.py.


The documentation for this class was generated from the following file: