From: Gerhard H?r. <gha...@us...> - 2001-09-08 16:12:54
|
Update of /cvsroot/pypgsql/pypgsql/test In directory usw-pr-cvs1:/tmp/cvs-serv9865/test Modified Files: PgSQLTestCases.py Log Message: 08SEP2001 gh - Made PgVersion_New safe for arbitrary input strings. - Made PgVersion's repr method really return the version string. - Added tests for PgVersion object. Index: PgSQLTestCases.py =================================================================== RCS file: /cvsroot/pypgsql/pypgsql/test/PgSQLTestCases.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PgSQLTestCases.py 2001/09/06 03:58:13 1.12 --- PgSQLTestCases.py 2001/09/08 16:12:51 1.13 *************** *** 33,36 **** --- 33,37 ---- # Date Ini Description | # --------- --- ------------------------------------------------------- | + # 08SEP2001 gh Added more tests for PgVersion object. | # 03SEP2001 gh Added more checks for PgMoney methods. | # 29JUL2001 bga Added test to check for correct handling of non-print- | *************** *** 439,443 **** except StandardError, msg: self.fail(msg) ! def CheckExecuteWithSingleton(self): """Test execute() with a singleton string as the parameter.""" --- 440,467 ---- except StandardError, msg: self.fail(msg) ! ! try: ! version = self.cnx.version ! a, b = coerce(version, '7.3.2') ! self.failUnless(type(a) == type(b) == type(version), ! 'Coercion from string to PgVersion failed.') ! a, b = coerce(version, 80205) ! self.failUnless(type(a) == type(b) == type(version), ! 'Coercion from int to PgVersion failed.') ! a, b = coerce(version, 80206L) ! self.failUnless(type(a) == type(b) == type(version), ! 'Coercion from long to PgVersion failed.') ! a, b = coerce(version, 80207.0) ! 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): """Test execute() with a singleton string as the parameter.""" |