Update of /cvsroot/pypgsql/pypgsql/test
In directory usw-pr-cvs1:/tmp/cvs-serv24390/test
Modified Files:
PgSQLTestCases.py
Log Message:
10SEP2001 bga Modified the test cases to reflect recent changes to pgversion.c
Index: PgSQLTestCases.py
===================================================================
RCS file: /cvsroot/pypgsql/pypgsql/test/PgSQLTestCases.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** PgSQLTestCases.py 2001/09/08 16:12:51 1.13
--- PgSQLTestCases.py 2001/09/10 04:42:36 1.14
***************
*** 33,36 ****
--- 33,43 ----
# Date Ini Description |
# --------- --- ------------------------------------------------------- |
+ # 09SEP2001 bga Modified tests to reflect changes to PgVersion object. |
+ # In particulare, a PgVersion object no longer has a |
+ # __dict__ attribute, but now acts as a mapping object. |
+ # The coerce method of the PgVersion object will always |
+ # succeed, but will return a 'special' PgVersion Object |
+ # that contains any error information if the coersion |
+ # failed. |
# 08SEP2001 gh Added more tests for PgVersion object. |
# 03SEP2001 gh Added more checks for PgMoney methods. |
***************
*** 261,265 ****
self.cnx = PgSQL.connect(database='template1')
self.cur = self.cnx.cursor()
! self.vstr = "%(major)d.%(minor)d" % self.cnx.version.__dict__
def tearDown(self):
--- 268,272 ----
self.cnx = PgSQL.connect(database='template1')
self.cur = self.cnx.cursor()
! self.vstr = "%(major)d.%(minor)d" % self.cnx.version
def tearDown(self):
***************
*** 432,438 ****
v = string.split(self.cur.fetchone()[0])[1]
self.cur.close()
! vstr = "%(major)d.%(minor)d" % self.cnx.version.__dict__
if self.cnx.version.level != 0:
! vstr = vstr + ".%(level)d" % self.cnx.version.__dict__
self.failUnlessEqual(v, vstr,
'SELECT version() says %s, cnx.version says %s' %
--- 439,445 ----
v = string.split(self.cur.fetchone()[0])[1]
self.cur.close()
! vstr = "%(major)d.%(minor)d" % self.cnx.version
if self.cnx.version.level != 0:
! vstr = vstr + ".%(level)d" % self.cnx.version
self.failUnlessEqual(v, vstr,
'SELECT version() says %s, cnx.version says %s' %
***************
*** 455,466 ****
self.failUnless(type(a) == type(b) == type(version),
'Coercion from float to PgVersion failed.')
except StandardError, msg:
self.fail(msg)
- try:
- a, b = coerce(version, '')
- self.fail('Coercion from garbage string to PgVersion *should*\
- have failed.')
- except TypeError, msg:
- pass # expected
def CheckExecuteWithSingleton(self):
--- 462,470 ----
self.failUnless(type(a) == type(b) == type(version),
'Coercion from float to PgVersion failed.')
+ a, b = coerce(version, '7. 1.3')
+ self.failUnless(b.post70 == None,
+ 'Coercion from garbage string to PgVersion *should* have failed.')
except StandardError, msg:
self.fail(msg)
def CheckExecuteWithSingleton(self):
|