[z3-checkins] r23428 - in z3/sqlos/trunk/src/sqlos: . ftests

jinty at codespeak.net jinty at codespeak.net
Thu Feb 16 23:45:54 CET 2006


Author: jinty
Date: Thu Feb 16 23:45:40 2006
New Revision: 23428

Modified:
   z3/sqlos/trunk/src/sqlos/_sqlos.py
   z3/sqlos/trunk/src/sqlos/ftests/connection.txt
Log:
Duh, the test was broken, not the code, so fix that.

Modified: z3/sqlos/trunk/src/sqlos/_sqlos.py
==============================================================================
--- z3/sqlos/trunk/src/sqlos/_sqlos.py	(original)
+++ z3/sqlos/trunk/src/sqlos/_sqlos.py	Thu Feb 16 23:45:40 2006
@@ -35,15 +35,6 @@
         >>> verifyObject(ISQLObject, s)
         True
 
-    We should not be able to override the _connection attribute on an instance:
-
-        >>> tmpcon = s._connection
-        >>> obj = 'x'
-        >>> s._connection = obj
-        >>> s._connection is not obj
-        True
-        >>> s._connection = tmpcon # if this test fails, we don't want to break others
-
     And finally call tearDown and cleanup:
 
         >>> testdb.tearDown()

Modified: z3/sqlos/trunk/src/sqlos/ftests/connection.txt
==============================================================================
--- z3/sqlos/trunk/src/sqlos/ftests/connection.txt	(original)
+++ z3/sqlos/trunk/src/sqlos/ftests/connection.txt	Thu Feb 16 23:45:40 2006
@@ -9,7 +9,8 @@
     ...     connection = ConnectionDescriptor()
     >>> dummy = Dummy()
 
-Assert that if we get a the real connection twice, we get the same connection:
+Assert that if we get a the real connection twice, we get the same low level
+connection:
 
     >>> conn1 = dummy.connection.makeConnection()
     >>> conn2 = dummy.connection.makeConnection()
@@ -33,3 +34,25 @@
     >>> thread.join()
     >>> log[0] is not conn1
     True
+
+On a SQLOS object instance, the connection descriptor cannot be overridden:
+    
+    >>> from sqlos.testing import sampleperson
+    >>> sampleperson.createTestingTables()
+    
+    >>> from zope.app import zapi
+    >>> from sqlos.interfaces import IISQLObject
+    >>> SamplePerson = zapi.getUtility(IISQLObject,
+    ...                                u'sqlos.somename.SamplePerson')
+    >>> harry = SamplePerson(username='h', fullname='H', password='p')
+
+    >>> tmpcon = harry._connection
+    >>> obj = 'x'
+    >>> harry._connection = obj
+    >>> harry._connection is not obj
+    True
+    >>> harry._connection = tmpcon # if this test fails, we don't want to break others
+
+CleanUp:
+
+    >>> sampleperson.dropTestingTables()


More information about the z3-checkins mailing list