[Zope-CVS] CVS: Products/Ape/apelib/tests - zope2testbase.py:1.4

Shane Hathaway shane@zope.com
Sat, 29 Mar 2003 17:28:21 -0500


Update of /cvs-repository/Products/Ape/apelib/tests
In directory cvs.zope.org:/tmp/cvs-serv10503/apelib/tests

Modified Files:
	zope2testbase.py 
Log Message:
Made _p_mtime work.  The modification time comes through a gateway and
gets installed by a serializer.

Note that the strategy we're using for SQL is starting to become
burdensome.  There is a lot of information we could collect with a
single query rather than several (currently a minimum of four queries
per object).  CompositeGateway is perhaps too simple.

Also updated the style of imports in sqlmapper and fsmapper.  By
importing modules rather than classes, the import statements are
simpler.  I think this is nice but not applicable everywhere.


=== Products/Ape/apelib/tests/zope2testbase.py 1.3 => 1.4 ===
--- Products/Ape/apelib/tests/zope2testbase.py:1.3	Sat Mar 29 14:44:56 2003
+++ Products/Ape/apelib/tests/zope2testbase.py	Sat Mar 29 17:27:50 2003
@@ -17,6 +17,7 @@
 """
 
 from cStringIO import StringIO
+import time
 
 from Acquisition import aq_base
 from ZODB import Persistent, POSException
@@ -527,3 +528,14 @@
         finally:
             conn.close()
 
+
+    def testModTime(self):
+        # Verify _p_mtime is within a reasonable range.
+        conn = self.db.open()
+        try:
+            now = time.time()
+            app = conn.root()['Application']
+            self.assert_(app._p_mtime > now - 10)
+            self.assert_(app._p_mtime < now + 10)
+        finally:
+            conn.close()