[PyGreSQL] [CVS] Change to pygresql: test_pg.py

Christoph Zwerschke cito at druid.net
Tue Sep 16 11:10:01 EDT 2008


Update of /usr/cvs/Public/pygresql/module
In directory druid.net:/tmp/cvs-serv12728

Modified Files:
	test_pg.py 
Log Message:
Small fixes in test suite.
To see the diffs for this commit:
   http://www.druid.net/pygresql/viewcvs.cgi/cvs/pygresql/module/test_pg.py.diff?r1=1.10&r2=1.11

Index: test_pg.py
===================================================================
RCS file: /usr/cvs/Public/pygresql/module/test_pg.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- test_pg.py	24 Feb 2007 07:41:07 -0000	1.10
+++ test_pg.py	16 Sep 2008 15:10:01 -0000	1.11
@@ -4,7 +4,7 @@
 #
 # Written by Christoph Zwerschke
 #
-# $Id: test_pg.py,v 1.10 2007/02/24 07:41:07 cito Exp $
+# $Id: test_pg.py,v 1.11 2008/09/16 15:10:01 cito Exp $
 #
 
 """Test the classic PyGreSQL interface in the pg module.
@@ -416,8 +416,8 @@
 		self.assertEqual(self.connection.db, self.dbname)
 
 	def testAttributeError(self):
-		no_error = ''
-		self.assertEqual(self.connection.error, no_error)
+		error = self.connection.error
+		self.assert_(not error or 'krb5_' in error)
 
 	def testAttributeHost(self):
 		def_host = 'localhost'
@@ -447,7 +447,10 @@
 		self.connection.query("select 1+1")
 
 	def testMethodEndcopy(self):
-		self.connection.endcopy()
+		try:
+			self.connection.endcopy()
+		except IOError:
+			pass
 
 	def testMethodClose(self):
 		self.connection.close()
@@ -699,9 +702,9 @@
 		self.assertEqual(self.db.dbname, self.dbname)
 
 	def testAttributeError(self):
-		no_error = ''
-		self.assertEqual(self.db.error, no_error)
-		self.assertEqual(self.db.db.error, no_error)
+		error = self.db.error
+		self.assert_(not error or 'krb5_' in error)
+		self.assertEqual(self.db.error, self.db.db.error)
 
 	def testAttributeHost(self):
 		def_host = 'localhost'
@@ -746,7 +749,10 @@
 		self.db.query("select 1+1")
 
 	def testMethodEndcopy(self):
-		self.db.endcopy()
+		try:
+			self.db.endcopy()
+		except IOError:
+			pass
 
 	def testMethodClose(self):
 		self.db.close()



More information about the PyGreSQL mailing list