Commit 4efce397 authored by Vincent Pelletier's avatar Vincent Pelletier

Fix test to follow changes introduced in r1856.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1857 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 336f4303
......@@ -192,14 +192,21 @@ class ClientApplicationTests(NeoTestBase):
mq = app.mq_cache
oid = self.makeOID()
tid = self.makeTID()
# cache cleared -> result from ZODB
# cache cleared
self.assertTrue(oid not in mq)
app.pt = Mock({ 'getCellListForOID': (), })
app.local_var.history = (oid, [(tid, 0)])
# If object len is 0, this object doesn't exist anymore because its
# creation has been undone.
self.assertRaises(KeyError, app.getSerial, oid)
self.assertEquals(len(app.pt.mockGetNamedCalls('getCellListForOID')), 1)
# Otherwise, result from ZODB
app.pt = Mock({ 'getCellListForOID': (), })
app.local_var.history = (oid, [(tid, 1)])
self.assertEquals(app.getSerial(oid), tid)
self.assertEquals(len(app.pt.mockGetNamedCalls('getCellListForOID')), 1)
# fill the cache -> hit
mq.store(oid, (tid, ''))
mq.store(oid, (tid, ' '))
self.assertTrue(oid in mq)
app.pt = Mock({ 'getCellListForOID': (), })
app.getSerial(oid)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment