Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
sqlite3.test.dbapi.ThreadTests Class Reference

List of all members.

Public Member Functions

def setUp
def tearDown
def CheckConCursor
def CheckConCommit
def CheckConRollback
def CheckConClose
def CheckCurImplicitBegin
def CheckCurClose
def CheckCurExecute
def CheckCurIterNext

Public Attributes

 con
 cur

Detailed Description

Definition at line 490 of file dbapi.py.


Member Function Documentation

Definition at line 554 of file dbapi.py.

00554 
00555     def CheckConClose(self):
00556         def run(con, errors):
00557             try:
00558                 con.close()
00559                 errors.append("did not raise ProgrammingError")
00560                 return
00561             except sqlite.ProgrammingError:
00562                 return
00563             except:
00564                 errors.append("raised wrong exception")
00565 
00566         errors = []
00567         t = threading.Thread(target=run, kwargs={"con": self.con, "errors": errors})
00568         t.start()
00569         t.join()
00570         if len(errors) > 0:
00571             self.fail("\n".join(errors))

Here is the call graph for this function:

Definition at line 518 of file dbapi.py.

00518 
00519     def CheckConCommit(self):
00520         def run(con, errors):
00521             try:
00522                 con.commit()
00523                 errors.append("did not raise ProgrammingError")
00524                 return
00525             except sqlite.ProgrammingError:
00526                 return
00527             except:
00528                 errors.append("raised wrong exception")
00529 
00530         errors = []
00531         t = threading.Thread(target=run, kwargs={"con": self.con, "errors": errors})
00532         t.start()
00533         t.join()
00534         if len(errors) > 0:
00535             self.fail("\n".join(errors))

Here is the call graph for this function:

Definition at line 500 of file dbapi.py.

00500 
00501     def CheckConCursor(self):
00502         def run(con, errors):
00503             try:
00504                 cur = con.cursor()
00505                 errors.append("did not raise ProgrammingError")
00506                 return
00507             except sqlite.ProgrammingError:
00508                 return
00509             except:
00510                 errors.append("raised wrong exception")
00511 
00512         errors = []
00513         t = threading.Thread(target=run, kwargs={"con": self.con, "errors": errors})
00514         t.start()
00515         t.join()
00516         if len(errors) > 0:
00517             self.fail("\n".join(errors))

Here is the call graph for this function:

Definition at line 536 of file dbapi.py.

00536 
00537     def CheckConRollback(self):
00538         def run(con, errors):
00539             try:
00540                 con.rollback()
00541                 errors.append("did not raise ProgrammingError")
00542                 return
00543             except sqlite.ProgrammingError:
00544                 return
00545             except:
00546                 errors.append("raised wrong exception")
00547 
00548         errors = []
00549         t = threading.Thread(target=run, kwargs={"con": self.con, "errors": errors})
00550         t.start()
00551         t.join()
00552         if len(errors) > 0:
00553             self.fail("\n".join(errors))

Here is the call graph for this function:

Definition at line 590 of file dbapi.py.

00590 
00591     def CheckCurClose(self):
00592         def run(cur, errors):
00593             try:
00594                 cur.close()
00595                 errors.append("did not raise ProgrammingError")
00596                 return
00597             except sqlite.ProgrammingError:
00598                 return
00599             except:
00600                 errors.append("raised wrong exception")
00601 
00602         errors = []
00603         t = threading.Thread(target=run, kwargs={"cur": self.cur, "errors": errors})
00604         t.start()
00605         t.join()
00606         if len(errors) > 0:
00607             self.fail("\n".join(errors))

Here is the call graph for this function:

Definition at line 608 of file dbapi.py.

00608 
00609     def CheckCurExecute(self):
00610         def run(cur, errors):
00611             try:
00612                 cur.execute("select name from test")
00613                 errors.append("did not raise ProgrammingError")
00614                 return
00615             except sqlite.ProgrammingError:
00616                 return
00617             except:
00618                 errors.append("raised wrong exception")
00619 
00620         errors = []
00621         self.cur.execute("insert into test(name) values ('a')")
00622         t = threading.Thread(target=run, kwargs={"cur": self.cur, "errors": errors})
00623         t.start()
00624         t.join()
00625         if len(errors) > 0:
00626             self.fail("\n".join(errors))

Here is the call graph for this function:

Definition at line 572 of file dbapi.py.

00572 
00573     def CheckCurImplicitBegin(self):
00574         def run(cur, errors):
00575             try:
00576                 cur.execute("insert into test(name) values ('a')")
00577                 errors.append("did not raise ProgrammingError")
00578                 return
00579             except sqlite.ProgrammingError:
00580                 return
00581             except:
00582                 errors.append("raised wrong exception")
00583 
00584         errors = []
00585         t = threading.Thread(target=run, kwargs={"cur": self.cur, "errors": errors})
00586         t.start()
00587         t.join()
00588         if len(errors) > 0:
00589             self.fail("\n".join(errors))

Here is the call graph for this function:

Definition at line 627 of file dbapi.py.

00627 
00628     def CheckCurIterNext(self):
00629         def run(cur, errors):
00630             try:
00631                 row = cur.fetchone()
00632                 errors.append("did not raise ProgrammingError")
00633                 return
00634             except sqlite.ProgrammingError:
00635                 return
00636             except:
00637                 errors.append("raised wrong exception")
00638 
00639         errors = []
00640         self.cur.execute("insert into test(name) values ('a')")
00641         self.cur.execute("select name from test")
00642         t = threading.Thread(target=run, kwargs={"cur": self.cur, "errors": errors})
00643         t.start()
00644         t.join()
00645         if len(errors) > 0:
00646             self.fail("\n".join(errors))

Here is the call graph for this function:

Definition at line 491 of file dbapi.py.

00491 
00492     def setUp(self):
00493         self.con = sqlite.connect(":memory:")
00494         self.cur = self.con.cursor()
00495         self.cur.execute("create table test(id integer primary key, name text, bin binary, ratio number, ts timestamp)")

Here is the caller graph for this function:

Definition at line 496 of file dbapi.py.

00496 
00497     def tearDown(self):
00498         self.cur.close()
00499         self.con.close()

Here is the caller graph for this function:


Member Data Documentation

Definition at line 492 of file dbapi.py.

Definition at line 493 of file dbapi.py.


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