[Zope-Checkins] CVS: Products/DCOracle2/test - test_zoracleda_basics.py:1.1.2.2

Chris Withers chris at simplistix.co.uk
Wed Feb 25 19:40:40 EST 2004


Update of /cvs-repository/Products/DCOracle2/test
In directory cvs.zope.org:/tmp/cvs-serv13732/test

Modified Files:
      Tag: chrisw_fixconnectionleak_branch
	test_zoracleda_basics.py 
Log Message:
Tests for Open/Close button behaviour.


=== Products/DCOracle2/test/test_zoracleda_basics.py 1.1.2.1 => 1.1.2.2 ===
--- Products/DCOracle2/test/test_zoracleda_basics.py:1.1.2.1	Tue Nov  4 16:47:45 2003
+++ Products/DCOracle2/test/test_zoracleda_basics.py	Wed Feb 25 19:40:40 2004
@@ -68,6 +68,25 @@
         sp._lobConvert(results)
         self.assertEqual(results,7566)
 
+    ### open connections
+    def test_manage_open_connection(self):
+        from Products.ZOracleDA import connections
+        from test_connections import _clearPool
+        _clearPool(connections)
+        self.da.manage_open_connection(self.REQUEST)
+        self.assertEqual(connections.countConnections(self._getConnectionString()),
+                         1)
+        self.failUnless(self.da.connected())
+        
+    def test_query_opens_connection(self):
+        from Products.ZOracleDA import connections
+        from test_connections import _clearPool
+        _clearPool(connections)
+        self.da().query('SELECT * from EMP')
+        self.assertEqual(connections.countConnections(self._getConnectionString()),
+                         1)
+        self.failUnless(self.da.connected())
+        
     ### close connections
     def test_manage_close_connection2(self,open=1):
         from Products.ZOracleDA import connections
@@ -77,9 +96,11 @@
             self.da().getDB()
             self.assertEqual(connections.countConnections(self._getConnectionString()),
                              1)
+            self.failUnless(self.da.connected())
         self.da.manage_close_connection(self.REQUEST)
         self.assertEqual(connections.countConnections(self._getConnectionString()),
                          0)
+        self.failIf(self.da.connected())
 
     def test_manage_close_connection_closed2(self):
         self.test_manage_close_connection2(0)




More information about the Zope-Checkins mailing list