Commit b007451a authored by Grégory Wisniewski's avatar Grégory Wisniewski

Update test for storage/bootstrap.py to follow changes on num_replicas.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@462 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent f5726ab1
......@@ -475,20 +475,29 @@ server: 127.0.0.1:10020
}
self.app.num_partitions = 1
self.app.num_replicas = 1
# partition number as changed -> error
self.assertRaises(
RuntimeError,
self.bootstrap.handleAcceptNodeIdentification,
num_partitions=self.app.num_partitions + 1,
num_replicas=self.num_replicas,
num_partitions=self.app.num_partitions + 2,
num_replicas=self.app.num_replicas,
**args)
self.assertRaises(
RuntimeError,
self.bootstrap.handleAcceptNodeIdentification,
self.assertEquals(len(conn.mockGetNamedCalls("setUUID")), 0)
self.assertEquals(len(conn.mockGetNamedCalls("addPacket")), 0)
self.assertEquals(len(conn.mockGetNamedCalls("expectMessage")), 0)
# create a new partition table
self.bootstrap.handleAcceptNodeIdentification(
num_partitions=self.app.num_partitions,
num_replicas=self.num_replicas + 1,
**args)
self.assertEquals(len(conn.mockGetNamedCalls("setUUID")), 0)
self.assertEquals(len(conn.mockGetNamedCalls("addPacket")), 0)
#self.assertEquals(self.app.num_partitions, self.num_partitions)
self.assertEquals(self.app.num_replicas, self.num_replicas + 1)
self.assertEqual(self.app.num_partitions, self.app.dm.getNumPartitions())
self.assertTrue(isinstance(self.app.pt, PartitionTable))
self.assertEquals(self.app.ptid, self.app.dm.getPTID())
self.assertEquals(len(conn.mockGetNamedCalls("setUUID")), 1)
self.assertEquals(len(conn.mockGetNamedCalls("addPacket")), 1)
self.assertEquals(len(conn.mockGetNamedCalls("expectMessage")), 1)
def test_09_handleAcceptNodeIdentification5(self):
# no errors
......@@ -515,7 +524,7 @@ server: 127.0.0.1:10020
# check PT
self.assertEquals(self.app.num_partitions, self.num_partitions)
self.assertEquals(self.app.num_replicas, self.num_replicas)
self.assertEqual(self.num_partitions, self.app.dm.getNumPartitions())
self.assertEqual(self.app.num_partitions, self.app.dm.getNumPartitions())
self.assertTrue(isinstance(self.app.pt, PartitionTable))
self.assertEquals(self.app.ptid, self.app.dm.getPTID())
# uuid
......
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