def test_setLastAccessed(self):
     t = self.t.new('xyzzy')
     ft = fauxtime.time()
     self.assert_(t.getLastAccessed() <= ft)
     fauxtime.sleep(self.timeout * 2)   # go to sleep past the granularity
     ft2 = fauxtime.time()
     t.setLastAccessed()
     ft3 = fauxtime.time()
     self.assert_(t.getLastAccessed() <= ft3)
     self.assert_(t.getLastAccessed() >= ft2)
Exemplo n.º 2
0
 def test_setLastAccessed(self):
     t = self.t.new('xyzzy')
     ft = fauxtime.time()
     self.assert_(t.getLastAccessed() <= ft)
     fauxtime.sleep(self.timeout)  # go to sleep past the granuarity
     ft2 = fauxtime.time()
     t.setLastAccessed()
     ft3 = fauxtime.time()
     self.assert_(t.getLastAccessed() <= ft3)
     self.assert_(t.getLastAccessed() >= ft2)
 def test_setLastAccessed(self):
     t = self.t.new('xyzzy')
     ft = fauxtime.time()
     assert t.getLastAccessed() <= ft
     fauxtime.sleep(self.timeout)   # go to sleep past the granuarity
     ft2 = fauxtime.time()
     t.setLastAccessed()
     ft3 = fauxtime.time()
     assert t.getLastAccessed() <= ft3
     assert t.getLastAccessed() >= ft2
Exemplo n.º 4
0
 def testAddNotification(self):
     self.app.sm.setAddNotificationTarget(addNotificationTarget)
     sdo = self.app.sm.new_or_existing('TempObject')
     now = fauxtime.time()
     k = sdo.get('starttime')
     self.assertEqual(type(k), type(now))
     self.assert_(k <= now)
 def testAddNotification(self):
     self.app.sm.setAddNotificationTarget(addNotificationTarget)
     sdo = self.app.sm.new_or_existing('TempObject')
     now = fauxtime.time()
     k = sdo.get('starttime')
     assert type(k) == type(now)
     assert k <= now
Exemplo n.º 6
0
 def testDelNotification(self):
     self.app.sm.setDelNotificationTarget(delNotificationTarget)
     sdo = self.app.sm.new_or_existing('TempObject')
     # sleep longer than timeout
     fauxtime.sleep(self.timeout * 100.0)
     self.app.sm.get('TempObject')
     now = fauxtime.time()
     k = sdo.get('endtime')
     self.assertEqual(type(k), type(now))
     self.assert_(k <= now)
 def testDelNotification(self):
     self.app.sm.setDelNotificationTarget(delNotificationTarget)
     sdo = self.app.sm.new_or_existing('TempObject')
     # sleep longer than timeout
     fauxtime.sleep(self.timeout * 100.0)
     self.app.sm.get('TempObject')
     now = fauxtime.time()
     k = sdo.get('endtime')
     self.assertEqual(type(k), type(now))
     self.assert_(k <= now)
Exemplo n.º 8
0
 def testDelNotification(self):
     self.app.sm.setDelNotificationTarget(delNotificationTarget)
     sdo = self.app.sm.new_or_existing('TempObject')
     timeout = self.timeout * 60
     # sleep 2X longer than timeout?  doesnt work at 1.1X, 1.5X?
     fauxtime.sleep(timeout * 2) 
     sdo1 = self.app.sm.get('TempObject')
     now = fauxtime.time()
     k = sdo.get('endtime')
     self.assertEqual(type(k), type(now))
     self.assert_(k <= now)
 def testDelNotification(self):
     self.app.sm.setDelNotificationTarget(delNotificationTarget)
     sdo = self.app.sm.new_or_existing('TempObject')
     timeout = self.timeout * 60
     fauxtime.sleep(timeout + (timeout * .75))
     sdo1 = self.app.sm.get('TempObject')
     # force the sdm to do housekeeping
     self.app.sm._housekeep(self.app.sm._deindex_next() -
                                self.app.sm._period)
     now = fauxtime.time()
     k = sdo.get('endtime')
     assert (type(k) == type(now)), type(k)
     assert k <= now, (k, now)
Exemplo n.º 10
0
def delNotificationTarget(item, context):
    item['endtime'] = fauxtime.time()
Exemplo n.º 11
0
 def testSetLastModified(self):
     t = self.t.new('xyzzy')
     ft = fauxtime.time()
     t.setLastModified()
     assert t.getLastModified() is not None
Exemplo n.º 12
0
 def test_getCreated(self):
     t = self.t.new('xyzzy')
     ft = fauxtime.time()
     assert t.getCreated() <= ft
Exemplo n.º 13
0
 def test_getLastAccessed(self):
     t = self.t.new('xyzzy')
     ft = fauxtime.time()
     assert t.getLastAccessed() <= ft
Exemplo n.º 14
0
def delNotificationTarget(item, context):
    item['endtime'] = fauxtime.time()
Exemplo n.º 15
0
 def testSetLastModified(self):
     t = self.t.new('xyzzy')
     ft = fauxtime.time()
     t.setLastModified()
     self.failIfEqual(t.getLastModified(), None)
Exemplo n.º 16
0
def addNotificationTarget(item, context):
    item['starttime'] = fauxtime.time()
Exemplo n.º 17
0
 def test_getLastAccessed(self):
     t = self.t.new('xyzzy')
     ft = fauxtime.time()
     self.assert_(t.getLastAccessed() <= ft)
Exemplo n.º 18
0
 def test_getCreated(self):
     t = self.t.new('xyzzy')
     ft = fauxtime.time()
     self.assert_(t.getCreated() <= ft)
Exemplo n.º 19
0
def addNotificationTarget(item, context):
    item['starttime'] = fauxtime.time()
Exemplo n.º 20
0
 def testSetLastModified(self):
     t = self.t.new('xyzzy')
     ft = fauxtime.time()
     t.setLastModified()
     self.failIfEqual(t.getLastModified(), None)