From: Billy G. A. <bal...@us...> - 2002-12-01 04:59:31
|
Update of /cvsroot/pypgsql/pypgsql/test/regression In directory sc8-pr-cvs1:/tmp/cvs-serv16107/test/regression Modified Files: pgconnection.py pgresult.py pgversion.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: pgconnection.py =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/test/regression/pgconnection.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pgconnection.py 17 Apr 2002 00:25:19 -0000 1.5 --- pgconnection.py 1 Dec 2002 04:59:25 -0000 1.6 *************** *** 35,38 **** --- 35,39 ---- # Date Ini Description | # --------- --- ------------------------------------------------------- | + # 30NOV2002 bga Updated tests for PostgreSQL 7.3. | # 17OCT2001 bga Added tests for lo_export(). | # 30SEP2001 bga Fixed a problem with the PgVersion object test related | *************** *** 206,210 **** Test sendQuery, consumeInput, and getResult. """ ! if self.vstr.startswith("7.2"): flen = 9 elif self.vstr.startswith("7.1"): --- 207,213 ---- Test sendQuery, consumeInput, and getResult. """ ! if self.vstr.startswith("7.3"): ! flen = 11 ! elif self.vstr.startswith("7.2"): flen = 9 elif self.vstr.startswith("7.1"): Index: pgresult.py =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/test/regression/pgresult.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** pgresult.py 17 Apr 2002 00:25:19 -0000 1.9 --- pgresult.py 1 Dec 2002 04:59:25 -0000 1.10 *************** *** 35,38 **** --- 35,39 ---- # Date Ini Description | # --------- --- ------------------------------------------------------- | + # 30NOV2002 bga Updated tests for PostgreSQL 7.3. | # 24SEP2001 bga Updated test case to use new string quoting method. | # 21SEP2001 bga Added check of the member types in certain test cases. | *************** *** 98,101 **** --- 99,104 ---- self.CheckForMethods(res) expected = [0, 'DROP', None, 0, 0, None, 1, 2 ] + if self.cnx.version >= '7.3': + expected[1] = 'DROP TABLE' self.CheckMemberValues(res, expected) # Try to drop the table again. This should raise an execption. *************** *** 114,117 **** --- 117,122 ---- self.CheckForMethods(res) expected = [0, 'CLOSE', None, 0, 0, None, 1, 2 ] + if self.cnx.version >= '7.3': + expected[1] = 'CLOSE CURSOR' self.CheckMemberValues(res, expected) *************** *** 123,133 **** self.CheckForMethods(res) expected = [0, 'FETCH', None, 0, 0, None, 1, 2 ] ! self.CheckMemberValues(res, expected) self.assertEquals(len(self.cnx.notices), 1, "A notice should of been generated, none was!") n = self.cnx.notices.pop() e = 'NOTICE: PerformPortalFetch: portal "pgres_cursor" not found\n' self.assertEquals(n, e, "The notice did not match expected results"); ! def CheckClosePgResult(self): res = self.cnx.query("CLOSE pgres_cursor") --- 128,142 ---- self.CheckForMethods(res) expected = [0, 'FETCH', None, 0, 0, None, 1, 2 ] ! if self.cnx.version >= '7.3': ! expected[1] = 'FETCH 0' ! self.CheckMemberValues(res, expected) self.assertEquals(len(self.cnx.notices), 1, "A notice should of been generated, none was!") n = self.cnx.notices.pop() e = 'NOTICE: PerformPortalFetch: portal "pgres_cursor" not found\n' + if self.cnx.version >= '7.3': + e = 'WARNING: PerformPortalFetch: portal "pgres_cursor" not found\n' self.assertEquals(n, e, "The notice did not match expected results"); ! def CheckClosePgResult(self): res = self.cnx.query("CLOSE pgres_cursor") *************** *** 135,138 **** --- 144,149 ---- self.CheckForMethods(res) expected = [0, 'CLOSE', None, 0, 0, None, 1, 2 ] + if self.cnx.version >= '7.3': + expected[1] = 'CLOSE CURSOR' self.CheckMemberValues(res, expected) *************** *** 142,145 **** --- 153,158 ---- self.CheckForMethods(res) expected = [1, 'FETCH', None, 2, 3, None, 2, 1 ] + if self.cnx.version >= '7.3': + expected[1] = 'FETCH 3' self.CheckMemberValues(res, expected) *************** *** 150,153 **** --- 163,168 ---- self.CheckForMethods(res) expected = [0, 'SELECT', None, 0, 0, None, 1, 2 ] + if self.cnx.version >= '7.3': + expected[1] = 'DECLARE CURSOR' self.CheckMemberValues(res, expected) *************** *** 157,163 **** --- 172,182 ---- self.CheckForMethods(res) expected = [0, 'MOVE', None, 0, 0, None, 1, 2 ] + if self.cnx.version >= '7.3': + expected[1] = 'MOVE 1' self.CheckMemberValues(res, expected) res = self.cnx.query("FETCH ALL FROM pgres_cursor") expected = [0, 'FETCH', None, 2, 4, None, 2, 1 ] + if self.cnx.version >= '7.3': + expected[1] = 'FETCH 4' self.CheckMemberValues(res, expected) *************** *** 167,170 **** --- 186,191 ---- self.CheckForMethods(res) expected = [0, 'FETCH', None, 2, 2, None, 2, 1 ] + if self.cnx.version >= '7.3': + expected[1] = 'FETCH 2' self.CheckMemberValues(res, expected) *************** *** 175,178 **** --- 196,201 ---- self.CheckForMethods(res) expected = [0, 'SELECT', None, 0, 0, None, 1, 2 ] + if self.cnx.version >= '7.3': + expected[1] = 'DECLARE CURSOR' self.CheckMemberValues(res, expected) *************** *** 226,229 **** --- 249,254 ---- self.CheckForMethods(res) expected = [0, 'CREATE', None, 0, 0, None, 1, 2 ] + if self.cnx.version >= '7.3': + expected[1] = 'CREATE TABLE' self.CheckMemberValues(res, expected) # Try to create the table again. This should raise an execption. *************** *** 231,235 **** def CheckPgResult(self): ! if self.vstr.startswith("7.2"): flen = 9 elif self.vstr.startswith("7.1"): --- 256,262 ---- def CheckPgResult(self): ! if self.vstr.startswith("7.3"): ! flen = 11 ! elif self.vstr.startswith("7.2"): flen = 9 elif self.vstr.startswith("7.1"): *************** *** 274,277 **** --- 301,306 ---- res = self.cnx.query("DROP TABLE pgresult_test") expected = [0, 'DROP', None, 0, 0, None, 1, 2 ] + if self.cnx.version >= '7.3': + expected[1] = 'DROP TABLE' self.CheckMemberValues(res, expected) self.failUnlessRaises(libpq.InterfaceError, res.fmod, 0) *************** *** 300,303 **** --- 329,334 ---- res = self.cnx.query("CLOSE pgres_cursor") expected = [0, 'CLOSE', None, 0, 0, None, 1, 2 ] + if self.cnx.version >= '7.3': + expected[1] = 'CLOSE CURSOR' self.CheckMemberValues(res, expected) self.failUnlessRaises(libpq.InterfaceError, res.fmod, 0) *************** *** 326,329 **** --- 357,362 ---- res = self.cnx.query("FETCH 2 FROM pgres_cursor") expected = [0, 'FETCH', None, 2, 2, None, 2, 1 ] + if self.cnx.version >= '7.3': + expected[1] = 'FETCH 2' self.CheckMemberValues(res, expected) self.assertEquals(res.fmod(0), -1, *************** *** 356,359 **** --- 389,394 ---- ORDER BY f1""") expected = [0, 'SELECT', None, 0, 0, None, 1, 2 ] + if self.cnx.version >= '7.3': + expected[1] = 'DECLARE CURSOR' self.CheckMemberValues(res, expected) self.failUnlessRaises(libpq.InterfaceError, res.fmod, 0) *************** *** 459,462 **** --- 494,499 ---- res = self.cnx.query(query) expected = [0, 'CREATE', None, 0, 0, None, 1, 2 ] + if self.cnx.version >= '7.3': + expected[1] = 'CREATE TABLE' self.CheckMemberValues(res, expected) self.failUnlessRaises(libpq.InterfaceError, res.fmod, 0) *************** *** 470,474 **** def CheckPgResult(self): ! if self.vstr.startswith("7.2"): flen = 9 elif self.vstr.startswith("7.1"): --- 507,513 ---- def CheckPgResult(self): ! if self.vstr.startswith("7.3"): ! flen = 11 ! elif self.vstr.startswith("7.2"): flen = 9 elif self.vstr.startswith("7.1"): Index: pgversion.py =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/test/regression/pgversion.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pgversion.py 12 Jan 2002 23:20:14 -0000 1.5 --- pgversion.py 1 Dec 2002 04:59:25 -0000 1.6 *************** *** 34,37 **** --- 34,39 ---- # Date Ini Description | # --------- --- ------------------------------------------------------- | + # 30NOV2002 bga Added tests for alpha, beta, and relase canidate vers. | + # --- Updated tests for PostgreSQL 7.3. | # 12JAN2001 bga Added test to check for correct operation of the fix | # for bug #486151. | *************** *** 165,168 **** --- 167,197 ---- try: + if version < 20100: + a, b = coerce(vers, '7.3rc2') + vers == b + else: + vers == '7.3rc2' + except ValueError, msg: + self.fail('Comparison to release canidate version failed.') + + try: + if version < 20100: + a, b = coerce(vers, '7.3b3') + vers == b + else: + vers == '7.3b3' + except ValueError, msg: + self.fail('Comparison to release canidate version failed.') + + try: + if version < 20100: + a, b = coerce(vers, '7.3a3') + vers == b + else: + vers == '7.3a3' + except ValueError, msg: + self.fail('Comparison to release canidate version failed.') + + try: vers == 4294967296L self.fail('Comparison to large valued long succeeded.') *************** *** 257,261 **** major = int(a[0]) minor = int(a[1]) ! if len(a[2]) == 0: level = 0 else: --- 286,290 ---- major = int(a[0]) minor = int(a[1]) ! if len(a) < 3: level = 0 else: |