Commit 6535cb41 authored by Grégory Wisniewski's avatar Grégory Wisniewski

Fix broken tests since getAssignedPartitionList()

git-svn-id: https://svn.erp5.org/repos/neo/trunk@1536 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent bbc7069f
...@@ -195,12 +195,16 @@ class StorageClientHandlerTests(NeoTestBase): ...@@ -195,12 +195,16 @@ class StorageClientHandlerTests(NeoTestBase):
packet.setId(0) packet.setId(0)
cell = Mock({'getUUID':self.app.uuid}) cell = Mock({'getUUID':self.app.uuid})
self.app.dm = Mock({'getTIDList': (INVALID_TID, )}) self.app.dm = Mock({'getTIDList': (INVALID_TID, )})
self.app.pt = Mock({'getCellList': (cell, ), 'getPartitions': 1}) self.app.pt = Mock({
'getCellList': (cell, ),
'getPartitions': 1,
'getAssignedPartitionList': [0],
})
self.operation.askTIDs(conn, packet, 1, 2, INVALID_PARTITION) self.operation.askTIDs(conn, packet, 1, 2, INVALID_PARTITION)
self.assertEquals(len(self.app.pt.mockGetNamedCalls('getCellList')), 1) self.assertEquals(len(self.app.pt.mockGetNamedCalls('getAssignedPartitionList')), 1)
calls = self.app.dm.mockGetNamedCalls('getTIDList') calls = self.app.dm.mockGetNamedCalls('getTIDList')
self.assertEquals(len(calls), 1) self.assertEquals(len(calls), 1)
calls[0].checkArgs(1, 1, 1, [0, ]) calls[0].checkArgs(1, 1, 1, [0])
self.checkAnswerTids(conn) self.checkAnswerTids(conn)
def test_26_askObjectHistory1(self): def test_26_askObjectHistory1(self):
......
...@@ -152,9 +152,13 @@ class StorageStorageHandlerTests(NeoTestBase): ...@@ -152,9 +152,13 @@ class StorageStorageHandlerTests(NeoTestBase):
packet.setId(0) packet.setId(0)
cell = Mock({'getUUID':self.app.uuid}) cell = Mock({'getUUID':self.app.uuid})
self.app.dm = Mock({'getTIDList': (INVALID_TID, )}) self.app.dm = Mock({'getTIDList': (INVALID_TID, )})
self.app.pt = Mock({'getCellList': (cell, ), 'getPartitions': 1}) self.app.pt = Mock({
'getCellList': (cell, ),
'getPartitions': 1,
'getAssignedPartitionList': [0],
})
self.operation.askTIDs(conn, packet, 1, 2, INVALID_PARTITION) self.operation.askTIDs(conn, packet, 1, 2, INVALID_PARTITION)
self.assertEquals(len(self.app.pt.mockGetNamedCalls('getCellList')), 1) self.assertEquals(len(self.app.pt.mockGetNamedCalls('getAssignedPartitionList')), 1)
calls = self.app.dm.mockGetNamedCalls('getTIDList') calls = self.app.dm.mockGetNamedCalls('getTIDList')
self.assertEquals(len(calls), 1) self.assertEquals(len(calls), 1)
calls[0].checkArgs(1, 1, 1, [0, ]) calls[0].checkArgs(1, 1, 1, [0, ])
...@@ -216,12 +220,16 @@ class StorageStorageHandlerTests(NeoTestBase): ...@@ -216,12 +220,16 @@ class StorageStorageHandlerTests(NeoTestBase):
packet.setId(0) packet.setId(0)
cell = Mock({'getUUID':self.app.uuid}) cell = Mock({'getUUID':self.app.uuid})
self.app.dm = Mock({'getOIDList': (INVALID_OID, )}) self.app.dm = Mock({'getOIDList': (INVALID_OID, )})
self.app.pt = Mock({'getCellList': (cell, ), 'getPartitions': 1}) self.app.pt = Mock({
'getCellList': (cell, ),
'getPartitions': 1,
'getAssignedPartitionList': [0],
})
self.operation.askOIDs(conn, packet, 1, 2, INVALID_PARTITION) self.operation.askOIDs(conn, packet, 1, 2, INVALID_PARTITION)
self.assertEquals(len(self.app.pt.mockGetNamedCalls('getCellList')), 1) self.assertEquals(len(self.app.pt.mockGetNamedCalls('getAssignedPartitionList')), 1)
calls = self.app.dm.mockGetNamedCalls('getOIDList') calls = self.app.dm.mockGetNamedCalls('getOIDList')
self.assertEquals(len(calls), 1) self.assertEquals(len(calls), 1)
calls[0].checkArgs(1, 1, 1, [0, ]) calls[0].checkArgs(1, 1, 1, [0])
self.checkAnswerOids(conn) self.checkAnswerOids(conn)
......
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