[Zope-Checkins] CVS: Zope/lib/python/Products/Transience/tests -
testTransientObjectContainer.py:1.14.38.2
Chris McDonough
chrism at plope.com
Sun Feb 29 15:16:18 EST 2004
Update of /cvs-repository/Zope/lib/python/Products/Transience/tests
In directory cvs.zope.org:/tmp/cvs-serv2839/tests
Modified Files:
Tag: chrism-sessiongeddon
testTransientObjectContainer.py
Log Message:
Deal with timeouts set to 0 (persist forever).
=== Zope/lib/python/Products/Transience/tests/testTransientObjectContainer.py 1.14.38.1 => 1.14.38.2 ===
--- Zope/lib/python/Products/Transience/tests/testTransientObjectContainer.py:1.14.38.1 Sun Feb 29 03:42:49 2004
+++ Zope/lib/python/Products/Transience/tests/testTransientObjectContainer.py Sun Feb 29 15:16:17 2004
@@ -31,6 +31,10 @@
Products.Transience.Transience.time = fauxtime
Products.Transience.TransientObject.time = fauxtime
Products.Transience.Transience.setStrict(1)
+ self.realstartup = Products.Transience.Transience.STARTUP_SLICE
+ fauxstartup = Products.Transience.Transience.getCurrentTimeslice()
+ Products.Transience.Transience.STARTUP_SLICE = fauxstartup
+
self.errmargin = .20
self.timeout = 60
self.t = TransientObjectContainer('sdc', timeout_mins=self.timeout/60)
@@ -40,6 +44,7 @@
Products.Transience.Transience.time = oldtime
Products.Transience.TransientObject.time = oldtime
Products.Transience.Transience.setStrict(0)
+ Products.Transience.Transience.STARTUP_SLICE = self.realstartup
class TestTransientObjectContainer(TestBase):
def testGetItemFails(self):
@@ -449,6 +454,14 @@
def testUnlimitedSubobjectLimitWorks(self):
self._maxOut()
+ def testZeroTimeoutMeansPersistForever(self):
+ self.t._setTimeout(0)
+ self.t._reset()
+ for x in range(10, 110):
+ self.t[x] = x
+ fauxtime.sleep(180)
+ assert len(self.t.keys()) == 100, len(self.t.keys())
+
def _maxOut(self):
for x in range(11):
self.t.new(str(x))
@@ -463,7 +476,6 @@
def test_suite():
testsuite = makeSuite(TestTransientObjectContainer, 'test')
- #testsuite = makeSuite(TestBase, 'test')
alltests = TestSuite((testsuite,))
return alltests
More information about the Zope-Checkins
mailing list