Commit 5a4fe397 authored by Aurel's avatar Aurel

test that if the connection to storage node is lost during load call,

it raises NotFound Error instead of failing


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@591 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 5c41439c
......@@ -208,6 +208,22 @@ class ClientApplicationTest(NeoTestBase):
tid1 = self.makeTID(1)
tid2 = self.makeTID(2)
an_object = (1, oid, tid1, tid2, 0, 0, '')
# connection to SN close
self.assertTrue(oid not in mq)
packet = protocol.oidNotFound('')
cell = Mock({ 'getUUID': '\x00' * 16})
conn = Mock({'getUUID': '\x10' * 16,
'getServer': ('127.0.0.1', 0),
'fakeReceived': packet,
})
app.local_var.queue = Mock({'get_nowait' : (conn, None)})
app.pt = Mock({ 'getCellList': (cell, ), })
app.cp = Mock({ 'getConnForNode' : conn})
app.local_var.asked_object = -1
Application._waitMessage = Application._waitMessage_org
self.assertRaises(NEOStorageNotFoundError, app.load, oid)
self.checkAskObject(conn)
Application._waitMessage = _waitMessage
# object not found in NEO -> NEOStorageNotFoundError
self.assertTrue(oid not in mq)
packet = protocol.oidNotFound('')
......
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