|
From: Billy G. A. <bal...@us...> - 2002-12-01 04:59:31
|
Update of /cvsroot/pypgsql/pypgsql/test
In directory sc8-pr-cvs1:/tmp/cvs-serv16107/test
Modified Files:
PgSQLTestCases.py
Log Message:
30NOV2002 bga Updated the test cases to account for changes in PostgreSQL 7.3.
28NOV2002 bga Fixed changed PG_TIMESTAMP oid, added PG_TIMESTAMPTZ and
PG_REFCURSOR oids. [Bug #845360] |
--- Reference cursors are now type-casted into cursor objects.
27NOV2002 bga Completed the emulation of a String object for the PgBytea and
PgOther classes. This corrects several problems with PgBytea
concerning comparisons, using PgBytea types as keys in
dictionaries, etc.
Index: PgSQLTestCases.py
===================================================================
RCS file: /cvsroot/pypgsql/pypgsql/test/PgSQLTestCases.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** PgSQLTestCases.py 11 Nov 2002 04:02:30 -0000 1.24
--- PgSQLTestCases.py 1 Dec 2002 04:59:25 -0000 1.25
***************
*** 33,36 ****
--- 33,37 ----
# Date Ini Description |
# --------- --- ------------------------------------------------------- |
+ # 30NOV2002 bga Updated tests for PostgreSQL 7.3. |
# 10NOV2002 bga Added an additional PgNumeric class check. |
# 27OCT2002 gh Don't check for the obsolete displaysize field in |
***************
*** 401,404 ****
--- 402,415 ----
self.cur = self.cnx.cursor()
self.vstr = "%(major)d.%(minor)d" % self.cnx.version
+ if self.cnx.version < '7.3':
+ self.expd = [['datname',PgSQL.PG_NAME,32,32,None,None,None,0],
+ ['datdba',PgSQL.PG_INT4,4,4,None,None,None,0],
+ ['encoding',PgSQL.PG_INT4,4,4,None,None,None,0],
+ ['datpath',PgSQL.PG_TEXT,-5,-1,None,None,None,0]]
+ else:
+ self.expd = [['datname',PgSQL.PG_NAME,64,64,None,None,None,0],
+ ['datdba',PgSQL.PG_INT4,4,4,None,None,None,0],
+ ['encoding',PgSQL.PG_INT4,4,4,None,None,None,0],
+ ['datacl',PgSQL.PG_ACLITEM,-5,-1,None,None,None,1]]
def tearDown(self):
***************
*** 605,611 ****
"""Test execute() with a singleton string as the parameter."""
! if self.vstr == "7.2":
flen = 9
! elif self.vstr == "7.1":
flen = 7
else:
--- 616,624 ----
"""Test execute() with a singleton string as the parameter."""
! if self.vstr.startswith("7.3"):
! flen = 11
! elif self.vstr.startswith("7.2"):
flen = 9
! elif self.vstr.startswith("7.1"):
flen = 7
else:
***************
*** 635,646 ****
len(self.cur.description[0]))
!
! self.failUnless(self.cur.description[0][0] == "datname" and
! self.cur.description[0][1] == PgSQL.PG_NAME and
! self.cur.description[0][3] == 32 and
! self.cur.description[0][4] == None and
! self.cur.description[0][5] == None and
! self.cur.description[0][6] == None and
! self.cur.description[0][7] == 0,
"cur.description[0] does not match the query.")
self.cur.close()
--- 648,658 ----
len(self.cur.description[0]))
! self.failUnless(self.cur.description[0][0] == self.expd[0][0] and
! self.cur.description[0][1] == self.expd[0][1] and
! self.cur.description[0][3] == self.expd[0][3] and
! self.cur.description[0][4] == self.expd[0][4] and
! self.cur.description[0][5] == self.expd[0][5] and
! self.cur.description[0][6] == self.expd[0][6] and
! self.cur.description[0][7] == self.expd[0][7],
"cur.description[0] does not match the query.")
self.cur.close()
***************
*** 655,665 ****
self.fail(msg)
! self.failUnless(self.cur.description[0][0] == "datname" and
! self.cur.description[0][1] == PgSQL.PG_NAME and
! self.cur.description[0][3] == 32 and
! self.cur.description[0][4] == None and
! self.cur.description[0][5] == None and
! self.cur.description[0][6] == None and
! self.cur.description[0][7] == 0,
"cur.description[0] does not match the query.")
self.cur.close()
--- 667,677 ----
self.fail(msg)
! self.failUnless(self.cur.description[0][0] == self.expd[0][0] and
! self.cur.description[0][1] == self.expd[0][1] and
! self.cur.description[0][3] == self.expd[0][3] and
! self.cur.description[0][4] == self.expd[0][4] and
! self.cur.description[0][5] == self.expd[0][5] and
! self.cur.description[0][6] == self.expd[0][6] and
! self.cur.description[0][7] == self.expd[0][7],
"cur.description[0] does not match the query.")
self.cur.close()
***************
*** 674,712 ****
self.fail(msg)
! self.failUnless(self.cur.description[0][0] == "datname" and
! self.cur.description[0][1] == PgSQL.PG_NAME and
! self.cur.description[0][3] == 32 and
! self.cur.description[0][4] == None and
! self.cur.description[0][5] == None and
! self.cur.description[0][6] == None and
! self.cur.description[0][7] == 0,
"cur.description[0] does not match the query.")
! self.failUnless(self.cur.description[1][0] == "datdba" and
! self.cur.description[1][1] == PgSQL.PG_INT4 and
! self.cur.description[1][3] == 4 and
! self.cur.description[1][4] == None and
! self.cur.description[1][5] == None and
! self.cur.description[1][6] == None and
! self.cur.description[1][7] == 0,
"cur.description[1] does not match the query.")
! self.failUnless(self.cur.description[2][0] == "encoding" and
! self.cur.description[2][1] == PgSQL.PG_INT4 and
! self.cur.description[2][3] == 4 and
! self.cur.description[2][4] == None and
! self.cur.description[2][5] == None and
! self.cur.description[2][6] == None and
! self.cur.description[2][7] == 0,
"cur.description[2] does not match the query.")
! clen = len(self.cur.description)
! self.failUnless(self.cur.description[clen - 1][0] == "datpath" and
! self.cur.description[clen - 1][1] == PgSQL.PG_TEXT and
! self.cur.description[clen - 1][3] == -1 and
! self.cur.description[clen - 1][4] == None and
! self.cur.description[clen - 1][5] == None and
! self.cur.description[clen - 1][6] == None and
! self.cur.description[clen - 1][7] == 0,
"cur.description[3] does not match the query.")
--- 686,724 ----
self.fail(msg)
! self.failUnless(self.cur.description[0][0] == self.expd[0][0] and
! self.cur.description[0][1] == self.expd[0][1] and
! self.cur.description[0][3] == self.expd[0][3] and
! self.cur.description[0][4] == self.expd[0][4] and
! self.cur.description[0][5] == self.expd[0][5] and
! self.cur.description[0][6] == self.expd[0][6] and
! self.cur.description[0][7] == self.expd[0][7],
"cur.description[0] does not match the query.")
! self.failUnless(self.cur.description[1][0] == self.expd[1][0] and
! self.cur.description[1][1] == self.expd[1][1] and
! self.cur.description[1][3] == self.expd[1][3] and
! self.cur.description[1][4] == self.expd[1][4] and
! self.cur.description[1][5] == self.expd[1][5] and
! self.cur.description[1][6] == self.expd[1][6] and
! self.cur.description[1][7] == self.expd[1][7],
"cur.description[1] does not match the query.")
! self.failUnless(self.cur.description[2][0] == self.expd[2][0] and
! self.cur.description[2][1] == self.expd[2][1] and
! self.cur.description[2][3] == self.expd[2][3] and
! self.cur.description[2][4] == self.expd[2][4] and
! self.cur.description[2][5] == self.expd[2][5] and
! self.cur.description[2][6] == self.expd[2][6] and
! self.cur.description[2][7] == self.expd[2][7],
"cur.description[2] does not match the query.")
! clen = len(self.cur.description) - 1
! self.failUnless(self.cur.description[clen][0] == self.expd[3][0] and
! self.cur.description[clen][1] == self.expd[3][1] and
! self.cur.description[clen][3] == self.expd[3][3] and
! self.cur.description[clen][4] == self.expd[3][4] and
! self.cur.description[clen][5] == self.expd[3][5] and
! self.cur.description[clen][6] == self.expd[3][6] and
! self.cur.description[clen][7] == self.expd[3][7],
"cur.description[3] does not match the query.")
***************
*** 787,791 ****
# Note: We only have to check for the minor version number in order
# to determine the needed row counts.
! rc = { '7.2':101, '7.1':80, '7.0':65, '6.5':47 }
v = self.vstr
--- 799,803 ----
# Note: We only have to check for the minor version number in order
# to determine the needed row counts.
! rc = { '7.3':124, '7.2':101, '7.1':80, '7.0':65, '6.5':47 }
v = self.vstr
|