Commit 7b8320d2 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Fix others getCellListFor(OID|TID)

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1400 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 7586e8de
...@@ -33,7 +33,8 @@ def _getMasterConnection(self): ...@@ -33,7 +33,8 @@ def _getMasterConnection(self):
self.num_partitions = 10 self.num_partitions = 10
self.num_replicas = 1 self.num_replicas = 1
self.pt = Mock({ self.pt = Mock({
'getCellListForID': (), 'getCellListForOID': (),
'getCellListForTID': (),
}) })
self.master_conn = Mock() self.master_conn = Mock()
return self.master_conn return self.master_conn
...@@ -115,7 +116,7 @@ class ClientApplicationTests(NeoTestBase): ...@@ -115,7 +116,7 @@ class ClientApplicationTests(NeoTestBase):
conn = Mock({ 'getNextId': 1, 'fakeReceived': packet, }) conn = Mock({ 'getNextId': 1, 'fakeReceived': packet, })
cell = Mock({ 'getAddress': 'FakeServer', 'getState': 'FakeState', }) cell = Mock({ 'getAddress': 'FakeServer', 'getState': 'FakeState', })
app.cp = Mock({ 'getConnForCell': conn}) app.cp = Mock({ 'getConnForCell': conn})
app.pt = Mock({ 'getCellListForID': (cell, cell, ) }) app.pt = Mock({ 'getCellListForOID': (cell, cell, ) })
return oid return oid
def voteTransaction(self, app): def voteTransaction(self, app):
...@@ -124,7 +125,7 @@ class ClientApplicationTests(NeoTestBase): ...@@ -124,7 +125,7 @@ class ClientApplicationTests(NeoTestBase):
packet = Packets.AnswerStoreTransaction(tid=tid) packet = Packets.AnswerStoreTransaction(tid=tid)
conn = Mock({ 'getNextId': 1, 'fakeReceived': packet, }) conn = Mock({ 'getNextId': 1, 'fakeReceived': packet, })
cell = Mock({ 'getAddress': 'FakeServer', 'getState': 'FakeState', }) cell = Mock({ 'getAddress': 'FakeServer', 'getState': 'FakeState', })
app.pt = Mock({ 'getCellListForID': (cell, cell, ) }) app.pt = Mock({ 'getCellListForTID': (cell, cell, ) })
app.cp = Mock({ 'getConnForCell': ReturnValues(None, conn), }) app.cp = Mock({ 'getConnForCell': ReturnValues(None, conn), })
app.tpc_vote(txn) app.tpc_vote(txn)
...@@ -360,9 +361,6 @@ class ClientApplicationTests(NeoTestBase): ...@@ -360,9 +361,6 @@ class ClientApplicationTests(NeoTestBase):
packet = Packets.AnswerBeginTransaction(tid=tid) packet = Packets.AnswerBeginTransaction(tid=tid)
app.master_conn = Mock({ app.master_conn = Mock({
'getNextId': 1, 'getNextId': 1,
'expectMessage': None,
'lock': None,
'unlock': None,
'fakeReceived': packet, 'fakeReceived': packet,
}) })
app.dispatcher = Mock({ }) app.dispatcher = Mock({ })
...@@ -577,7 +575,7 @@ class ClientApplicationTests(NeoTestBase): ...@@ -577,7 +575,7 @@ class ClientApplicationTests(NeoTestBase):
self.assertFalse(app.local_var.txn is txn) self.assertFalse(app.local_var.txn is txn)
conn = Mock() conn = Mock()
cell = Mock() cell = Mock()
app.pt = Mock({'getCellListForID': (cell, cell)}) app.pt = Mock({'getCellListForTID': (cell, cell)})
app.cp = Mock({'getConnForCell': ReturnValues(None, cell)}) app.cp = Mock({'getConnForCell': ReturnValues(None, cell)})
app.tpc_finish(txn) app.tpc_finish(txn)
# no packet sent # no packet sent
...@@ -709,7 +707,10 @@ class ClientApplicationTests(NeoTestBase): ...@@ -709,7 +707,10 @@ class ClientApplicationTests(NeoTestBase):
'getAddress': ('127.0.0.1', 10010), 'getAddress': ('127.0.0.1', 10010),
}) })
cell = Mock({ 'getAddress': 'FakeServer', 'getState': 'FakeState', }) cell = Mock({ 'getAddress': 'FakeServer', 'getState': 'FakeState', })
app.pt = Mock({ 'getCellListForID': (cell, ) }) app.pt = Mock({
'getCellListForTID': (cell, ),
'getCellListForOID': (cell, ),
})
app.cp = Mock({ 'getConnForCell': conn}) app.cp = Mock({ 'getConnForCell': conn})
wrapper = Mock({'tryToResolveConflict': None}) wrapper = Mock({'tryToResolveConflict': None})
txn4 = self.beginTransaction(app, tid=tid4) txn4 = self.beginTransaction(app, tid=tid4)
......
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