Commit 5118c372 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Register answered packet in fake environment.

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1401 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 7b8320d2
......@@ -103,6 +103,8 @@ class ClientApplicationTests(NeoTestBase):
return txn
def beginTransaction(self, app, tid):
packet = Packets.AnswerBeginTransaction(tid=tid)
app.master_conn = Mock({ 'fakeReceived': packet, })
txn = self.makeTransactionObject()
app.tpc_begin(txn, tid=tid)
return txn
......@@ -345,6 +347,11 @@ class ClientApplicationTests(NeoTestBase):
# first, tid is supplied
self.assertNotEquals(getattr(app, 'tid', None), tid)
self.assertNotEquals(getattr(app, 'txn', None), txn)
packet = Packets.AnswerBeginTransaction(tid=tid)
app.master_conn = Mock({
'getNextId': 1,
'fakeReceived': packet,
})
app.tpc_begin(transaction=txn, tid=tid)
self.assertTrue(app.local_var.txn is txn)
self.assertEquals(app.local_var.tid, tid)
......
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