[Zope-Checkins] CVS: Zope/lib/python/Products/Transience/tests - testTransientObject.py:1.4.16.1
Chris McDonough
chrism@zope.com
Sat, 23 Mar 2002 23:38:43 -0500
Update of /cvs-repository/Zope/lib/python/Products/Transience/tests
In directory cvs.zope.org:/tmp/cvs-serv31369/tests
Modified Files:
Tag: Zope-2_5-branch
testTransientObject.py
Log Message:
Transient objects now maintain a last_modified attribute which
is set when a transient object's __getitem__ or __delitem__ is called.
The conflict resolution method of transient objects now uses the
last_modified time when deciding which if any of the three states
to return. Objects with a later last modified time are preferred.
Additionally, the conflict resolution machinery now identifies any
state which has been invalidated and returns it.
=== Zope/lib/python/Products/Transience/tests/testTransientObject.py 1.4 => 1.4.16.1 ===
assert t.getCreated() <= ft
+ def test_getLastModifiedUnset(self):
+ t = self.t.new('xyzzy')
+ assert t.getLastModified() == None
+
+ def test_getLastModifiedSet(self):
+ t = self.t.new('xyzzy')
+ t['a'] = 1
+ assert t.getLastModified() is not None
+
+ def testSetLastModified(self):
+ t = self.t.new('xyzzy')
+ ft = fauxtime.time()
+ t.setLastModified()
+ assert t.getLastModified() is not None
+
def test_setLastAccessed(self):
t = self.t.new('xyzzy')
ft = fauxtime.time()