Update of /cvsroot/pypgsql/pypgsql/test/regression
In directory usw-pr-cvs1:/tmp/cvs-serv10326/regression
Modified Files:
pgconnection.py pgresult.py
Log Message:
17APR2002 gh Fix some of the regression tests to also work with PostgreSQL
version 7.2. I'm not sure what to to about the differences
related to the output of cmdStatus, though.
Index: pgconnection.py
===================================================================
RCS file: /cvsroot/pypgsql/pypgsql/test/regression/pgconnection.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** pgconnection.py 3 Nov 2001 19:03:49 -0000 1.4
--- pgconnection.py 17 Apr 2002 00:25:19 -0000 1.5
***************
*** 206,209 ****
--- 206,216 ----
Test sendQuery, consumeInput, and getResult.
"""
+ if self.vstr.startswith("7.2"):
+ flen = 9
+ elif self.vstr.startswith("7.1"):
+ flen = 7
+ else:
+ flen = 4
+
try:
cnx.sendQuery("""select * from pg_database
***************
*** 220,224 ****
self.assertEquals(res.ntuples, 1,
'Query return wrong number of tuples.')
! self.assertEquals(res.nfields, 7,
'Query return wrong number of fields.')
if res.getvalue(0,0) != 'template1' or \
--- 227,231 ----
self.assertEquals(res.ntuples, 1,
'Query return wrong number of tuples.')
! self.assertEquals(res.nfields, flen,
'Query return wrong number of fields.')
if res.getvalue(0,0) != 'template1' or \
Index: pgresult.py
===================================================================
RCS file: /cvsroot/pypgsql/pypgsql/test/regression/pgresult.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** pgresult.py 18 Oct 2001 03:17:08 -0000 1.8
--- pgresult.py 17 Apr 2002 00:25:19 -0000 1.9
***************
*** 231,238 ****
def CheckPgResult(self):
res = self.cnx.query("SELECT * FROM pg_database LIMIT 3")
self.CheckForMembers(res)
self.CheckForMethods(res)
! expected = [0, 'SELECT', None, 7, 3, None, 2, 1 ]
self.CheckMemberValues(res, expected)
--- 231,245 ----
def CheckPgResult(self):
+ if self.vstr.startswith("7.2"):
+ flen = 9
+ elif self.vstr.startswith("7.1"):
+ flen = 7
+ else:
+ flen = 4
+
res = self.cnx.query("SELECT * FROM pg_database LIMIT 3")
self.CheckForMembers(res)
self.CheckForMethods(res)
! expected = [0, 'SELECT', None, flen, 3, None, 2, 1 ]
self.CheckMemberValues(res, expected)
***************
*** 463,466 ****
--- 470,480 ----
def CheckPgResult(self):
+ if self.vstr.startswith("7.2"):
+ flen = 9
+ elif self.vstr.startswith("7.1"):
+ flen = 7
+ else:
+ flen = 4
+
res = self.cnx.query("SELECT * FROM pg_database LIMIT 3")
expected = [types.IntType, types.StringType, types.NoneType,
***************
*** 468,472 ****
types.IntType, types.IntType ]
self.CheckMemberTypes(res, expected)
! expected = [0, 'SELECT', None, 7, 3, None, 2, 1 ]
self.CheckMemberValues(res, expected)
# Check that fname returns the expected results
--- 482,486 ----
types.IntType, types.IntType ]
self.CheckMemberTypes(res, expected)
! expected = [0, 'SELECT', None, flen, 3, None, 2, 1 ]
self.CheckMemberValues(res, expected)
# Check that fname returns the expected results
|