[Zodb-checkins] CVS: ZODB3/Persistence/tests - testPersistent.py:1.1.2.3

Jeremy Hylton jeremy at zope.com
Thu Jul 3 16:17:53 EDT 2003


Update of /cvs-repository/ZODB3/Persistence/tests
In directory cvs.zope.org:/tmp/cvs-serv3218/tests

Modified Files:
      Tag: zodb33-devel-branch
	testPersistent.py 
Log Message:
Add test for mtime.


=== ZODB3/Persistence/tests/testPersistent.py 1.1.2.2 => 1.1.2.3 ===
--- ZODB3/Persistence/tests/testPersistent.py:1.1.2.2	Thu Jul  3 14:16:06 2003
+++ ZODB3/Persistence/tests/testPersistent.py	Thu Jul  3 15:17:48 2003
@@ -11,10 +11,12 @@
 # FOR A PARTICULAR PURPOSE.
 #
 ##############################################################################
+import time
 import unittest
 
 from Persistence import Persistent
 from Persistence.cPickleCache import PickleCache
+from Persistence.TimeStamp import TimeStamp
 from ZODB.utils import p64
 
 class Jar(object):
@@ -132,6 +134,18 @@
         obj._p_serial = "01234567"
         del obj._p_serial
         self.assertEqual(obj._p_serial, noserial)
+
+    def testTime(self):
+        obj = P()
+        self.assertEqual(obj._p_mtime, None)
+
+        t = int(time.time())
+        ts = TimeStamp(*time.gmtime(t)[:6])
+        obj._p_serial = repr(ts)
+        self.assertEqual(obj._p_mtime, t)
+        self.assert_(isinstance(obj._p_mtime, float))
+
+    # tests with __getattr__, __getattribute__, and __setattr__
         
 
 def test_suite():




More information about the Zodb-checkins mailing list